Package com.secondstack.training.basic.inheritance

Examples of com.secondstack.training.basic.inheritance.Person


*
* @author Latief
*/
public class InheritanceMain {
    public static void main(String[] args) {
        Person joko = new Person();
        joko.setName("Joko");
        joko.setAlamat("Yogyakarta");
        showPerson(joko);
       
        Person siti = new Person("Siti", "Bandung");
        showPerson(siti);
       
        showPerson(new Person("Doni", "Semarang"));
       
        Student sahrul = new Student();
        sahrul.setName("Sahrul");
        sahrul.setAlamat("Yogyakarta");
        sahrul.setNoInduk("001");
        sahrul.setSekolah("SMA YOGYAKARTA");
        showStudent(sahrul);
       
        Person juwita = new Student();
        juwita.setName("Juwita");
        juwita.setAlamat("Yogyakarta");
        showPerson(juwita);
        showStudent((Student) juwita);
       
        Student studentJuwita = (Student) juwita;
        studentJuwita.setNoInduk("002");
View Full Code Here

TOP

Related Classes of com.secondstack.training.basic.inheritance.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.