How do you call a method from another class in Java Android?

How do you call a method from another class in Java Android?
Answer
You should use the following code : Class2 cls2 = new Class2(); cls2. UpdateEmployee(); In case you don’t want to create a new instance to call the method, you can decalre the method as static and then you can just call Class2.
 

Tìm kiếm

Back
Top