Kamrul13981

10

Mar 1st, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package task10;
  2.  
  3. class Employee {
  4.     String name;
  5.     int Joining_Year,salary;
  6.     String address;
  7. }
  8. public class Task10 {
  9.  
  10.    
  11.     public static void main(String[] args) {
  12.       Employee E1 = new Employee();
  13.        E1.name = "Robert";
  14.        E1.Joining_Year = 1994;
  15.        E1.address = "64C- WallsStreat";
  16.      
  17.        Employee E2 = new Employee();
  18.        E2.name = "Sam";
  19.       E2.Joining_Year  = 2000;
  20.        E2.address = "68D- WallsStreat";
  21.        
  22.        Employee E3 = new Employee();
  23.        E3.name = "John";
  24.        E3.Joining_Year  = 1999;
  25.        E3.address = "26B- WallsStreat";
  26.        
  27.        System.out.println("a. Name     Year of joining      Address ");
  28.        System.out.println("b. "+E1.name+"     "+E1.Joining_Year +"           "+E1.address);
  29.        System.out.println("c. "+E2.name+"        "+E2.Joining_Year +"           "+E2.address);
  30.        System.out.println("d. "+E3.name+"       "+E3.Joining_Year +"           "+E3.address);  
  31.     }
  32.    
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment