Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 868 Bytes

README.md

File metadata and controls

41 lines (29 loc) · 868 Bytes

OOPS

class Employee{ int id; String name; int salary; public void printDetails(){ System.out.println("My salary is" + salary); System.out.println("and my name is" + name); }

}

  public class oops_customclass {

public static void main(String[] args) {
   // System.out.println("This is our custom class");
    
   
   // setting attributes
    //Employee harry= new Employee();
    harry.id=12;
    harry.salary=1200;
    //harry.name="CodeWithHarry";
   // System.out.println(harry.id);
   // System.out.println(harry.name);
  //harry.printDetails();
    
  //Employee john= new Employee();
  //john.id=17;
  //john.name="john khandelwal";
  //john.printDetails();

  //harry.printDetails();
  //harry.printDetails();



}

}