public void add() { int a = 10; int b = 20; int c = a + b; System.out.println("Addition result: " + c); } } import let_me_cal.calculator;
public class Demo1 {
public static void main(String args[]) { calculator c1 = new calculator(); c1.add(); } } package my_institute;
public class Department {
public void displayStaff() { System.out.println("Staff of the department:"); System.out.println("- Harsh"); System.out.println("- Amey "); System.out.println("-Yash ");
} } import my_institute.Department;
public class Main2 {
public static void main(String[] args) { Department department = new Department(); department.displayStaff(); } }