MAC:Mon Oct 25:09:33:interfaces> ls Circle.java Shape.java MAC:Mon Oct 25:09:33:interfaces> javac *.java MAC:Mon Oct 25:09:33:interfaces> jshell | Welcome to JShell -- Version 17 | For an introduction type: /help intro jshell> Circle c = new Circle(10); | Error: | cannot find symbol | symbol: class Circle | Circle c = new Circle(10); | ^----^ | Error: | cannot find symbol | symbol: class Circle | Circle c = new Circle(10); | ^----^ jshell> /open Shape.java jshell> /open Circle.java jshell> Circle c = new Circle(10); c ==> Circle@6e8cf4c6 jshell> c.area() $4 ==> 314.1592653589793 jshell> c.diameter() $5 ==> 20.0 jshell> c.perimeter() $6 ==> 62.83185307179586 jshell> Shape s = new Shape(); | Error: | Shape is abstract; cannot be instantiated | Shape s = new Shape(); | ^---------^ jshell> s = new Circle(10); | Error: | cannot find symbol | symbol: variable s | s = new Circle(10); | ^ jshell> Shape s = new Circle(10); s ==> Circle@27973e9b jshell> s.area() $8 ==> 314.1592653589793 jshell> /exit | Goodbye MAC:Mon Oct 25:09:39:interfaces> wget https://faculty.ncssm.edu/~morrison/currentClasses/4240/Oct/25Oct21/Rectangle.java --2021-10-25 09:39:40-- https://faculty.ncssm.edu/~morrison/currentClasses/4240/Oct/25Oct21/Rectangle.java SSL_INIT Resolving faculty.ncssm.edu (faculty.ncssm.edu)... 192.154.43.11 Connecting to faculty.ncssm.edu (faculty.ncssm.edu)|192.154.43.11|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 443 [text/plain] Saving to: ‘Rectangle.java’ Rectangle.java 100%[===================>] 443 --.-KB/s in 0s 2021-10-25 09:39:40 (35.2 MB/s) - ‘Rectangle.java’ saved [443/443] MAC:Mon Oct 25:09:39:interfaces> javac *.java MAC:Mon Oct 25:09:39:interfaces> jshell | Welcome to JShell -- Version 17 | For an introduction type: /help intro jshell> Shape s = new Rectangle(6,8); | Error: | cannot find symbol | symbol: class Shape | Shape s = new Rectangle(6,8); | ^---^ | Error: | cannot find symbol | symbol: class Rectangle | Shape s = new Rectangle(6,8); | ^-------^ jshell> /open Shape.java jshell> /open Circle.java jshell> /open Rectangle.java jshell> Shape s = new Rectangle(6,8); s ==> Rectangle@34c45dca jshell> s.area() $5 ==> 48.0 jshell> s.diameter() $6 ==> 10.0 jshell> s.perimeter | Error: | cannot find symbol | symbol: variable perimeter | s.perimeter | ^---------^ jshell> s.perimeter() $7 ==> 28.0 jshell> ArrayList al = new ArrayList<>(); al ==> [] jshell> al.add(new Circle(10)); $9 ==> true jshell> al.add(new Rectangle(6,8)); $10 ==> true jshell> al al ==> [Circle@3d494fbf, Rectangle@1ddc4ec2] jshell> /exit | Goodbye MAC:Mon Oct 25:09:46:interfaces> vi Rectangle.java MAC:Mon Oct 25:09:47:interfaces> javac *.java MAC:Mon Oct 25:09:47:interfaces> jshell | Welcome to JShell -- Version 17 | For an introduction type: /help intro jshell> Shape s = new Rectangle(6,8); | Error: | cannot find symbol | symbol: class Shape | Shape s = new Rectangle(6,8); | ^---^ | Error: | cannot find symbol | symbol: class Rectangle | Shape s = new Rectangle(6,8); | ^-------^ jshell> /open Shape.java jshell> /open Circle.java jshell> /open Rectangle.java jshell> Shape s = new Rectangle(6,8); s ==> Rectangle@34c45dca jshell> s.area() $5 ==> 48.0 jshell> s.numSides() | Error: | cannot find symbol | symbol: method numSides() | s.numSides() | ^--------^ jshell> s.getClass() $6 ==> class Rectangle jshell> s = new Circle(10); s ==> Circle@312b1dae jshell> s.area() $8 ==> 314.1592653589793 jshell> List ell = new ArrayList<>(); ell ==> [] jshell> ell.add("a"); $10 ==> true jshell> ell.add("b"); $11 ==> true jshell> ell.add("z") $12 ==> true jshell> ell.add("y"); $13 ==> true jshell> ell ell ==> [a, b, z, y] jshell> Collections.sort(ell); jshell> ell ell ==> [a, b, y, z] jshell> ell ell ==> [a, b, y, z] jshell> ell = new LinkedList<>()); | Error: | ';' expected | ell = new LinkedList<>()); | ^ jshell> ell = new LinkedList<>(); ell ==> [] jshell> ell.add("a") $19 ==> true jshell> ell.add("b"); $20 ==> true jshell> ell.add("c"); $21 ==> true jshell> ell ell ==> [a, b, c] jshell> Collections.sort(ell); jshell> Map m = new TreeMap<>(); m ==> {} jshell> m.put("cats", 5); $25 ==> null jshell> m m ==> {cats=5} jshell> m.put("dogs", 10); $27 ==> null jshell> m.put("elephants", 1); $28 ==> null jshell> m m ==> {cats=5, dogs=10, elephants=1} jshell> m.get("cats") $30 ==> 5 jshell> m.set("cats", 13); | Error: | cannot find symbol | symbol: method set(java.lang.String,int) | m.set("cats", 13); | ^---^ jshell> m.put("cats", 13); $31 ==> 5 jshell> m.put("cats", m.get("cats") + 10); $32 ==> 13 jshell> m m ==> {cats=23, dogs=10, elephants=1} jshell> Map s = new HashMap<>(); s ==> {} jshell> s.put(new Rectangle(1,1), 3); $35 ==> null jshell> s s ==> {Rectangle@6e2c634b=3} jshell> s.put(new Circle(1,1), 3); | Error: | constructor Circle in class Circle cannot be applied to given types; | required: double | found: int,int | reason: actual and formal argument lists differ in length | s.put(new Circle(1,1), 3); | ^-------------^ jshell> /open Circle.java jshell> s.put(new Circle(1), 3); $38 ==> null jshell> s s ==> {Circle@7c3df479=3, Rectangle@6e2c634b=3} jshell> /exit | Goodbye MAC:Mon Oct 25:10:25:interfaces>