• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can someone show me how to run these three classes in one main method.  RSS feed

 
Steven Morales
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm new to programming.  Can someone please show me how I can run all three classes I have below in one main method.  I'm using Eclipse.  Thank you in advance!

 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you have there are three methods in one class, not three different classes.

The code in the main() method will be executed when you run your program as an application in Eclipse.

To execute the code in the main2() and main3() methods, then you'd have to make a method call. Search for how to call a method in Java. Were you not taught this in your class already?
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and Welcome to the Ranch!
 
Steven Morales
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. And no, we were not taught this yet. 


Junilu Lacar wrote:What you have there are three methods in one class, not three different classes.

The code in the main() method will be executed when you run your program as an application in Eclipse.

To execute the code in the main2() and main3() methods, then you'd have to make a method call. Search for how to call a method in Java. Were you not taught this in your class already?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!