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 is your definition of Digital Safety?
mina [271]

Answer:

Digital Safety is being knowledgeable in the areas of Internet safety, device security, etc. and keeping yourself safe when using the Internet.

Explanation:

When you know how to stay safe on the Internet and keep yourself safe, you know Digital Safety.

4 0
3 years ago
Which of the following is one of the tools used by a Python IDE that helps prevent syntax errors?
Gala2k [10]

Answer:A. It adds color to keywords.

Explanation:

A. It adds color to keywords.

3 0
3 years ago
1. Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative va
Inessa05 [86]

Answer:

Hence the answer is given as follows,

4 0
4 years ago
Which method will return the first element in an ArrayList employees?
Wittaler [7]

Answer:

employees.get(0)

Explanation:

In the programming, the index of ArrayList start from zero.

So, the element start storing in the ArrayList from the zero index.

get() is the function which is used to retrieve or getting the value in the

ArrayList.

The function employees.get(0), it retrieve the element of zero index.

The function employees.get(1), it retrieve the element of first index.

The function employees.first(1), it is wrong calling.

The function employees.get(), it is wrong calling. you have to enter the index value inside the get().

3 0
3 years ago
An automated search feature used by search engines to find results that match your search terms is called a spider or _______. A
Sphinxa [80]

The answer is C: Crawler

The job of a search crawler and a web spider is the same. Actually, a search engine has many different names, such as automatic indexers and web spiders. A crawler is a program that browses the World Wide Web systematically in order to provide updated data to the particular search engine. Its purpose is to create entries for a search engine index. A crawler works by getting a list of URL’s to visit and store. It gets copies which it stores to the search engine to later index.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Spencer is a recent graduate who finds a dream car that costs $45,000. Even better, there's a 0% APR for 36 months offer from th
    13·1 answer
  • Assume that the system has a multiple level queue with a variable time quantum per queue, and that the incoming job needs 80 ms
    14·1 answer
  • How do computer worms spread​
    11·1 answer
  • Is something wrong with Brainly?
    5·2 answers
  • An image can be copied from the Internet or another location and pasted into Paint.
    13·1 answer
  • For each 8-bit data frame the layer uses a generator polynomial G(x) = x4+x2+ x+1 to add redundant bits. What is the sequence of
    11·1 answer
  • Which element of the Word program window displays information about the current document, such as number of pages, and also incl
    14·1 answer
  • You have been hired by a small company to install a backbone to connect four 100base-T Ethernet LANs (each using one 24-port hub
    12·1 answer
  • What does a GPA show
    14·2 answers
  • Pls help me Pls help me
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!