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.UpdateEmployee()
.
More Related Contents:
- Creating new Android (Java ) file in Existing Android package [closed]
- Android Unable to instantiate activity: Didn’t find class on path
- How can I start a new android activity using class name in a string?
- Android – Get real path of a .txt file selected from the file explorer
- Maximum length of Intent putExtra method? (Force close)
- Sending arrays with Intent.putExtra
- How do you use Intent.FLAG_ACTIVITY_CLEAR_TOP to clear the Activity Stack?
- How to use interface to communicate between two activities
- Prevent Android activity dialog from closing on outside touch
- How do you pass a string from one activity to another? [duplicate]
- Android – Activity Constructor vs onCreate
- How to start Activity in adapter?
- Android Studio cannot resolve symbol but code executes correctly
- android.app.Application cannot be cast to android.app.Activity
- Android Center text on canvas
- Getting class by its name
- How to resume Android Activity programmatically from background
- Curly braces in “new” expression? (e.g. “new MyClass() { … }”)
- DeadObjectException on android app
- Can we instantiate an abstract class directly? [duplicate]
- How to exit an Android app programmatically?
- The activity must be exported or contain an intent-filter
- Android “single top” launch mode and onNewIntent method
- resuming an activity from a notification
- how to programatically theme an activity to be like a dialog?
- Class must either be declared abstract or implement abstract method error
- IllegalArgumentException: Unknown URL content:// CONTENT
- Android: Navigation-Drawer on all activities
- Passing ArrayList of string arrays from one activity to another in android
- Using the camera activity in Android