Posted on December 2, 2018 by adminThinking in Java Fourth Edition Bruce Eckel Chapter 1 Exercise 6 Exercise 6: Write a program that includes and calls the storage( ) method defined as a code fragment in this chapter. Solution: public class StorageTest { public static void main(String[] args) { class StoreStuff { int storage(String s) { return s.length() * 2; } } StoreStuff x = new StoreStuff(); System.out.println(x.storage("hi")); } } Output: Related posts: Thinking in Java Fourth Edition Bruce Eckel Chapter 7 Exercise 15 Thinking in Java Fourth Edition Bruce Eckel Chapter 1 Exercise 12 Thinking in Java Fourth Edition Bruce Eckel Chapter 7 Exercise 8 Thinking in Java Fourth Edition Bruce Eckel Chapter 7 Exercise 4