Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to call a Java class from another java class ??

Hi ..... can somebody plz tell me

How to call a Java Class from another Java Class assuming both in the same Package??

I want to call the entire Java Class (not any specific method only........I want all the functionalities of that class)

Please provide me some slotuions!!

Waiting for some fast replies!!


Smita Mohanty

Former Member
Former Member replied

Hi Smita,

you just need to create an object of that class,thats it. Then you will be able to execute each and every method.


you have developed and, both are in same package.

in implementaion of

class B


A obj = new A();

//to access A's methods


// to access A's variable


A.variable= value.


A.setvariable() or A.getvariable()


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question