Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could I please have help with A, B, C, and D? A. (3 points) Given the following code, what is the output? Assume a public
Could I please have help with A, B, C, and D?
A. (3 points) Given the following code, what is the output? Assume a public number instance variable, and an equals() method within the Bus class that uses only this instance variable to check if two Bus objects values' are semantically equal Bus busAnew Bus ); Bus busBnew Bus ); busA.number- 33; I/The 33 is the Florida of PVTA bus routes. busB.number33: System.out.println (busAbusB); System.out.println(busA.equals(busB)) Bus busCbusA busAbusB busA.number43: System.out.println (busAbusC); System.out.println(busA.equals(busc)); busC-busA; System.out.println (busBbusC) System.out.println(busB.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, which is in turn located inside Users directory) is on your classpatlh Suppose the first line of a Java source file named "Bear.java" is: package animals.mammals; Where exactly should this file be located? Specify the full path to the file. For example, a wrong answer is "in /Users/Bear.java". Another wrong answer is /animals/mammals/Bear.java C. (2 points) Suppose we add a file named Eagle.java to the project above, and we want the Eagle class to reside in the animals.birds package. What should the first line (the package declaration) of the Eagle.java file be? And, what should the full path to the file be? D. (1 point) Finally, suppose we want to reference the Eagle class from within the Bear.java source. What import statement must we to add to the Bear.java file? If none is necessary, say soStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started