Prac 20new1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Prac 20

package let_me_cal;

public class calculator {


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();
}
}

You might also like