Java inner classes

Posted: September 15, 2014 in Java
Tags:

Dahili sınıflar(inner classes)-> sınıf içerisinde tanımlanmış sınıf diye adlandırabiliriz.

public class X {

public class inner_classes
{

public void metod1()

{
System.out.println(“inner classes”);

}

public void metod2(int a ,int b)

{

System.out.println(a*b);

}

}

public static void main(String[] args) {

X.inner_classes a=new X(). new inner_classes();
a.metod1();
a.metod2(7, 8);

}

}

inner classes

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