Java Super class and Sub Class

Posted: September 13, 2014 in Java
Tags:

package insan;

class computer {

public computer ()

{
System.out.println(“computer”);

}

public static void main(String[] args) {

CB2SE1 B1 = new CB2SE1();

}

}

class masaüstü extends computer {

public masaüstü()

{
System.out.println(“masaüstü”);

}

}

class sony extends masaüstü {

public sony ()

{

System.out.println(“Sony marka”);

}

}

class CB2SE1 extends sony {

public CB2SE1 ()

{

System.out.println(“CB2SE1 modeli”);
}

}

super class

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s