Thursday, 3 December 2015

Java Tutorial : Java Creating Objects


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 
Employee.java
public class Employee
{

    String name;
    int age;

    public Employee(String name, int age)
    {
        this.name = name;
        this.age = age;
    }
    
}
EmployeeTest.java
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 );
    }

}
Output
name : John
age : 25
------------------------------------------
name : Peter
age : 28
Click the below link to download the code:
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:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment