Contoh Java
inner_class.java
package inner_class; public class Inner_class { public static void main(String[] args) { System.out.println(" INNER CLASS"); System.out.println(); induk x = new induk(); System.out.println(" hasil penambahan ="+x.penambahan(20,5)); System.out.println(" hasil perkalian ="+x.kali(20, 5)); induk.anak y = x.new anak(); System.out.println("hasil perkalian =" +y.perkalian(10, 5)); induk.anak.cucu z = y.new cucu(); System.out.println("hasil pengurangan =" +z.pengurangan(25,5)); } }