Question: code in java, You are Given the UML of the two classes, and the main class. There are five syntax errors in the main. Find
You are Given the UML of the two classes, and the main class. There are five syntax errors in the main. Find the error, and explain why it is wrong. P.S: do not correct error. You have to explain why there is an error. Human age: int name: Name + Human(A:int, a:Name) + equals(other:Obiect): boolean Name first: String last: String +Name($1:String,s2-String) + toString(): String 1 2 3 4 5 6 7 8 9 10 11 12 public class Exercise public static void main(String[] args) { Human hl= new Human(); Human h2 new Human (23, new Name ("John Doel Human h3 = new Object Human h4 Object ol - new Object 03 Object 02 new Human (22, new Name{"Rodney", "Rod")); System.out.println (h2.aget" "+h2.name); System.out.println(h2.toString(); System.out.printlnthi.tostring(): System.out.println(equals (hl, ol)); System.out.println (h2.equals(2)}; 13 14 15 Put your answers here: Line with Error Explanation (Why it is wrong)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
