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
Leya [2.2K]
3 years ago
14

Would this program compile run? If not, why; if yes: what would be the output? public class ConstChaini { public static void mai

n(String [] args){ new SubClass(); System.out.println(); new SubClass(1); } class SuperClass{ public SuperClass(){ System.out.print(-4-); } public SuperClass(int i){ System.out.print("8"); } } class SubClass extends SuperClass( public SubClass()( this(1e); System.out.print(C"); } public SubClass(int i){ super(i); System.out.print("D"); }
Computers and Technology
1 answer:
nikdorinn [45]3 years ago
8 0

Answer:

Check the explanation

Explanation:

// Code to copy

public class ConstChain1 {

public static void main(String[] args)

{

new SubClass();

System.out.println();

new SubClass(1);

}

}

class SuperClass{

public SuperClass() {

System.out.println("D");

}

public SuperClass(int i) {

System.out.println("C");

}

}

class SubClass extends SuperClass{

public SubClass() {

this(10);

System.out.println("B");

}

public SubClass(int i) {

super(i);

System.out.println("A");

}

}

Explanation:

Now each time when a object of a subclass is been created it's super class constructor will be executed first then only subclass object is created by executing it's constructor.

You might be interested in
What kind of value should an employee possess when employees are expected to be responsible and fair?
WINSTONCH [101]

I'd say professionalism

Professionalism in a workplace setup is acting in a responsible and fair manner in all your personal and work activities. It is always seen as sign of maturity and self-confidence. This work value includes learning every aspect of a job and performing it to the best of your God given ability.

3 0
3 years ago
. Alex discovered a bunch of SATA drives in a box at the office and needs to check the contents. What can he do so that Windows
ZanzabumX [31]

You have to make sure the BIOS boot is set to the normal hard drive first, then plug in the SATA cable and power properly

8 0
3 years ago
)How to extract a specific element of item in a list?
pogonyaev

Answer:

List items are usually accessed using the indexing operator.

Explanation:

Depends on the language, and what you mean with extracting? Do you mean accessing or removing?

3 0
3 years ago
What is a type of machine-to-human communication?
suter [353]
I don’t know what it’s called but it’s where they can speak by moving there eyes
3 0
3 years ago
What’s the answer for this
attashe74 [19]
I believe the answer is B<span />
3 0
3 years ago
Other questions:
  • Which of the following can be sources of sediment? A. fragments of other rocks B. chemicals and minerals dissolved in water C. s
    11·1 answer
  • .exe, .msi, .msp, .inf - together, what do these filetypes indicate
    12·2 answers
  • What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
    12·1 answer
  • Jeremy wants to run a program file from the command prompt. Which of the following should Jeremy type in the command prompt wind
    8·2 answers
  • Lucy wants to develop a web page to display her profile. She wants to just start with a basic page that lists her accomplishment
    13·1 answer
  • There are two main advantages to using multiple threads in a process: 1) Less work involved in creating a new thread rather than
    7·1 answer
  • What is software piracy?
    11·1 answer
  • A program that doesn’t work properly needs to be debugged. true or false
    8·1 answer
  • Why was the tesla model s help change the was we see EV
    12·1 answer
  • What is computer topology​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!