class Lib { String objType; String objName; static String libLocation = "Midfield St."; public Lib(String type, String name) { this.objType = type; this.objName = name; } private String getObjName() { return this.objName; } // inner class static class Book { String description; void printLibraryLocation(){ System.out.println("Library location: "+libLocation); } } } public class Main { public static void main(String[] args) { Lib.Book book = new Lib.Book(); book.printLibraryLocation(); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter