Calling a class from another class

Is there a way to call another class from the main class? Pretty new to java!
Matt VilkAsked:
Who is Participating?
 
Martin MillerConnect With a Mentor CTOCommented:
You're asking a common OO, Object Oriented question, main()::  is just a kick-off, or starting point. You can instantiate, and "call" another class, you will need to import/add package where the other class is defined. There is more to this... that links to build and classpath. But your simple answer is YES.

I found one link that may be of reference for you:
https://www.quora.com/How-does-one-main-method-be-called-in-another-class-main-method-in-Java
0
 
krakatoaConnect With a Mentor Commented:
you will need to import/add package where the other class is defined.

?. Could you expand on this please?
0
 
Martin MillerCTOCommented:
Can we close this question ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.