Click here to watch in Youtube :
https://www.youtube.com/watch?v=yJAuuDAF4Yo&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Creating Objects |
Java Tutorial : Java Creating Objects |
Java Tutorial : Java Creating Objects |
Java Tutorial : Java Creating Objects |
Java Tutorial : Java Creating Objects |
public class Employee { String name; int age; public Employee(String name, int age) { this.name = name; this.age = age; } }
public class EmployeeTest { public static void main(String[] args) { Employee johnReferenceVariable = new Employee("John", 25); Employee peterReferenceVariable = new Employee("Peter", 28); System.out.println("name : "+ johnReferenceVariable.name ); System.out.println("age : "+ johnReferenceVariable.age ); System.out.println("------------------------------------------"); System.out.println("name : "+ peterReferenceVariable.name); System.out.println("age : "+ peterReferenceVariable.age ); } }
name : John age : 25 ------------------------------------------ name : Peter age : 28
https://sites.google.com/site/javaee4321/java/CreateObjectDemoApp.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/CreateObjectDemoApp
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/68054fa19b88e552162495a83ba964283753af15/BasicJava/CreateObjectDemoApp/?at=master
See also:
No comments:
Post a Comment