Tuesday 11 August 2015

Java Tutorial : Class Structure


Click here to watch in Youtube :
https://www.youtube.com/watch?v=tnJzctk-Utk&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Class Structure 
Java Tutorial : Class Structure 
Java Tutorial : Class Structure 
Java Tutorial : Class Structure 
Java Tutorial : Class Structure 
Person.java
/**
 * Person class is the blueprint from which individual Person objects can be
 * created.
 */
public class Person
{
    String name;
    int age;

    public void displayMsg()
    {
        System.out.println("I am " + name);
        System.out.println("I am " + age + " yrs. old");
    }

}
PersonDemo.java
public class PersonDemo
{
    public static void main(String[] args)
    {

        Person peter = new Person();
        /*
         * Setting Attributes/Properties/Characteristics.
         */
        peter.name = "Peter";
        peter.age = 53;

        peter.displayMsg();

    }

}
Output
I am Peter
I am 53 yrs. old

To Download PersonDemoStructure Project Click the below link
https://sites.google.com/site/javaee4321/java/PersonDemoStructure.zip?attredirects=0&d=1

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