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 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"); } }
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(); } }
I am Peter
I am 53 yrs. old
https://sites.google.com/site/javaee4321/java/PersonDemoStructure.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment