1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Westkost [7]
3 years ago
14

a. Show the output of the following program: 1: public class Test { 2: public static void main ( String [] args ) { 3: A a = new

A( 3 ); 4: } 5: } 6: 7: class A extends B { 8: public A ( int t ) { 9: System.out.println( "A's constructor is invoked" ); 10: } 11: } 12: 13: class B { 14: public B () { 15: System.out.println( "B's constructor is invoked" ); 16: } 17: } b. Is the no-arg constructor of Object invoked when new A(3) is invoked? 6. Indicate true or false for the follow statements: a. You can always successfully cast an instance of a subclass to a superclass. b. You can always successfully cast an instance of a superclass to a subclass. 7. What's wrong with the following code? 1: public class Test { 2: public static void main ( String [] args ) { 3: Object fruit = new Fruit(); 4: Object apple = (Apple) fruit; 5: } 6: } 7: 8: class Apple extends Fruit { 9: } 10: 11: class Fruit { 12: } 8. When overriding the equals method, a common mistake is mistyping its signature in the subclass. For example, the equals method is incorrectly written as equals (Circle circle) as shown in (a) below. It should be written as equals(Object circle), as shown in (b) below. Show the output of running class Test using the Circle class first from (a), and then from (b). Explain the output. 1: public class Test { 2: public static void main ( String [] args ) { 3: Object circle1 = new Circle(); 4: Object circle2 = new Circle(); 5: System.out.println( circle1.equals( circle2 ) );
Computers and Technology
1 answer:
faust18 [17]3 years ago
3 0

Answer:

See attached file.

Explanation:

See attached file.

Download txt
You might be interested in
What risks, threats, and vulnerabilities are prominent with wlan infrastructures?
vovangra [49]
The threats as well as the risk and vulnerabilities are present with the WLAN. The WLAN would encounter security issues with the range of the signal which is wireless, SSID broadcasting, password security and the packet sniffing or the capturing of signal.
4 0
3 years ago
What HTML tag would you use to indicate a line break?
DIA [1.3K]

Answer:

<br> APEX Verified

Explanation:

8 0
3 years ago
Cite los botones de edición que existen y determine en que ficha y grupo se encuentran.
Alina [70]

Answer:

GHRUDIFDSFHEOUSDHFHESDHFHEFE

Explanation:

SORRY I DONT KNOW

5 0
3 years ago
What are the third generation of computer?​
balu736 [363]

The period of third generation was from 1965-1971. The computers of third generation used Integrated Circuits (ICs) in place of transistors. A single IC has many transistors, resistors, and capacitors along with the associated circuitry. The IC was invented by Jack Kilby.

3 0
3 years ago
Read 2 more answers
Consider the following list. list = {24, 20, 10, 75, 70, 18, 60, 35} Suppose that list is sorted using the selection sort algori
Nadya [2.5K]

Answer:

list =  {10, 18, 24, 75, 70, 20, 60, 35}

Explanation:

Selection is a sorting algorithm that will set a cursor position and search for a minimum number from the list. When the minimum number is found, that minimum number will be swapped with the number in the cursor position. Only one number will be swapped and sorted in one iteration of outer loop. To sort the next number in the following outer loop iteration, the cursor will be moved to the next position and repeat the same search and swapping process as in the first iteration. When finishing all the iterations of outer loop, all numbers shall be sorted in ascending order.

4 0
3 years ago
Other questions:
  • Why are resources limited? Why can't we get everything all the time?
    12·1 answer
  • Which of the following is NOT one of the most important elements when designing a website?
    8·2 answers
  • You can click a web page title on the _____ list to return to that page.
    10·1 answer
  • What protects original and creative expression of an idea?
    6·2 answers
  • Question 12 (1 point)
    6·1 answer
  • A _____ is a valuable tool that enables a user to find information on the Web by specifying words or phrases known as keywords,
    10·2 answers
  • Different he launc.<br>in function are available with MS-Excel<br>Many​
    14·1 answer
  • Which requires large computer memory?
    15·1 answer
  • ❤️❤️❤️❤️❤️❤️❤️❤️IS THERE ANYONE'S STILL AWAKE?? HMM HEHE I'M HERE AGAIN~~~ FOLLOW ME FOR MOR3~~​
    10·2 answers
  • owever, sitting in a corner of the store, a hacker had just set up an open "rogue" wireless hotspot posing as the coffee shop’s
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!