I have three classes Client,Product and Main.How can I call the client and the product from the main ?
Tuz 0 Newbie Poster
Recommended Answers
Jump to PostIn java, all you need to do is reference them from main.
...just like you would reference almost any other class.
...unless they are buried in some other package.Are they in separate files?
Jump to PostA couple of things you should know:
1) When you post code, please use the [ CODE ] button at the top edge of the post and put your code in the tags so it displays in a better format.
2) Only ONE of your classes can have a main() …
Jump to PostAnd
3) Learn to indent.
Jump to PostOnly one module can contain main() and there can only be ONE main().
Just for the record: any or every class in your program can have a
public static void main(String[] args)
method. It's up to you which one you run when you start the program.
Like many other people …
All 14 Replies
thines01 401 Postaholic Team Colleague Featured Poster
Tuz 0 Newbie Poster
thines01 401 Postaholic Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Tuz 0 Newbie Poster
Tuz 0 Newbie Poster
thines01 401 Postaholic Team Colleague Featured Poster
Tuz 0 Newbie Poster
Tuz 0 Newbie Poster
Tuz 0 Newbie Poster
thines01 401 Postaholic Team Colleague Featured Poster
Tuz 0 Newbie Poster
thines01 401 Postaholic Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.