Sie sind auf Seite 1von 1

public class InnerClassDemo { private inrcls inrobj; class inrcls { public int width; public int height; public

String toString() { return width + " x " + height; } } public InnerClassDemo() { inrcls inrobj = new inrcls(); inrobj.width = 100; inrobj.height = 200; this.inrobj = inrobj; } public inrcls getinrcls() { return this.inrobj; } public static void main(String[] args) { InnerClassDemo inner = new InnerClassDemo(); System.out.println("inner.getinrcls() = " + inner.getinrcls()); } }