Loading video...
QuickNotes™ 
Using Objects
Objects are instances of classes. for example to declare an object of Employee class type:
Employee emp ;
To instantiate (allocate memory and initialize) an object key word new is used:
emp = new Employee() ;
Objects can be declared and instantiated at the same time:
Employee emp = new Employee() ;
To access an object methods it has to be instantiated. To access a method DOT . (access operator) is used
emp.print(); // calls the print method associated with Employee class String name = emp.getName() ;
Discussion 
Please login to ask a question and view discussion.













