Question: A. (3 points) Given the following code, what is the output? Assume a public number instance variable, and equals() method that uses only this instance

A. (3 points) Given the following code, what is the output? Assume a public number instance variable, and equals() method that uses only this instance variable to check if two Bus objects values' are semantically equal. Bus busa = new Bus(); Bus busB = new Bus(); busa. number -44; bus. number - 443 System.out.println(busa == busB); System.out.println(busa.equals(bus)); Bus busc = bus; bus-bus; busa. number - 13; System.out.println(busa == busc); System.out.println(busA.equals(busc)); busc busB; System.out.println(busa == busc); spaces etc Page 1 of 2 Fall 2018 1/17/21, 1:08 PM System.out.println(busa.equals(busc)); B. (1 point) Suppose you have a single directory on your CLASSPATH, /Users/student/src/. That is, the src directory (located inside student, located inside Users) is on your classpath. Suppose the first line of a Java source file named "Banana.java" is: package produce, fruits; Where exactly should this file be located? Specify the full path to the file. For example, a wrong answer is "in /Users/Banana.java". Another wrong answer is /produce/fruits/Banana.java. C. (2 points) Suppose we add a file named "Broccoli.java" to the project above, and we want the Broccoli class to reside in the produce vegetables package. What should the first line (the package declaration) of the Broccoli.java file be? And, what should the full path to the file be? D. (1 point) Finally, suppose we want to reference the Broccoli class from within the "Banana.java" source. What import statement must we to add to the Banana.java file? If none is necessary, say so
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
