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
Setler79 [48]
3 years ago
15

Meg[] elements = {new Lois(), new Stewie(), new Meg(), new Brian()}; for (int i =0; i

Computers and Technology
1 answer:
Stells [14]3 years ago
7 0

Complete question is attached as snapshot.

Answer:

This will result in a compilation error.

Here's the inheritance hierarchy:

Meg -> Lois -> Brian -> Stewie

Now Meg has 2 public Fxns, a() and toString().

Lois inherits from Meg and all its public functions as well but, overrides the a() fxn of its super class.

So finally Lois has fxns a(), b() and toString().

Brian extends Lois and inherits all the above listed fxns of Lois, but overrides the b() and toString() fxns.

Stewie extends Brian and inherits all the fxns of Brian, but overrides the a() and toString() fxns.

In the Main driver fxn, we call a() and b() methods of all these classes but, the base class Meg has no b() and it is not extending any class so its not available in its scope.

This results in a compilation error.

Explanation:

You might be interested in
For each of the following languages, state with justification whether it isrecognizableor unrecognizable.(a)LHALT≥376={(〈M〉, x)
Scilla [17]

Answer:

See the picture attached

Explanation:

4 0
3 years ago
The dome of Hagia Sophia rests on these curving, triangular features of Byzantine architecture called __________.
kipiarov [429]

Answer:

pendentives

Explanation:

4 0
3 years ago
Create a program that contains 4 methods / functions... main(), getTestScores(), calcAverage(), and displayAverage(). The main()
jeyben [28]

Answer:

import java.util.Scanner;

public class  num6{

   static int getTestScores(){

       System.out.println("Enter the Score");

       Scanner in = new Scanner(System.in);

       int score = in.nextInt();

       return score;

   }

   static double calcAverage(int score1, int score2, int score3){

       return (score1+score2+score3)/3;

   }

   static void displayAverage(double ave){

       System.out.println("The Average is "+ave);

   }

   public static void main(String[] args) {

       int num1 = getTestScores();

       int num2 = getTestScores();

       int num3 = getTestScores();

       //Calling Calculate Average

       double average = calcAverage(num1,num2,num3);

       //Calling displayAverage

       displayAverage(average);

   }

}

Explanation:

  • Using Java programming Language
  • Create the four methods
  • getTestScores() Uses the Scanner Class to receive an in variable and return it
  • calcAverage() accepts three ints as parameter calculates their average and return it
  • displayAverage() Accepts a double and prints it out with a concatenated string as message
  • In the Main Method, getTestScores is called three times to obtain three numbers from the user
  • calAverage is called and handed the three numbers
  • printAverage is called to output the calculated average
8 0
3 years ago
In the tcp/ip protocol that allows communication across the internet, what does tcp do?
DedPeter [7]

TCP tells or state how applications can make channels of communication across a network.

<h3>What is the role of TCP?</h3>

TCP is known to often help in the management of how a message is put together into smaller packets before they are sent or transmitted over the internet and then put together again in the right way at the arriving or destination address.

Therefore, TCP tells or state how applications can make channels of communication across a network.

Learn more about TCP from

brainly.com/question/17387945

#SPJ11

7 0
2 years ago
Based on the chart below, which pie flavors make up approximately one-half of the total? A pie chart shows the following pie fla
Vladimir [108]
Based on the data, a combination of strawberry rhubarb (12%), chocolate mud pie (23%) and cherry (14%) would amount to 49% which is close to half of the pie chart or 50%. Another probable answer is the combination of coconut (9%), banana cream (10%), pumpkin (11%), and other (21%) which is equal to 51%.
8 0
3 years ago
Read 2 more answers
Other questions:
  • What determines the keystroke to open a cmos editor? how can you find this information?
    15·1 answer
  • The piece of hardware that contains the circuitry that processes the information coming in to the computer and tells the other h
    8·1 answer
  • What conclusion did Freud reach when attempting to understand the connection between psychological and physical problems?
    12·1 answer
  • Suppose you have four 500 MB hard drives plus one 2 GB flash drive. How many GB of capacity is this overall?
    12·1 answer
  • Given a collection of n nuts and a collection of n bolts, arranged in an increasing order of size, give an O(n) time algorithm t
    5·1 answer
  • 4. Written record of all transactions in your checking account
    5·2 answers
  • What are the steps to creating a blank database? Use the drop-down menus to complete them.
    9·1 answer
  • What are the origins of the parking barrier?
    12·1 answer
  • There are several design goals in building an operating system; for example, resource utilization, timeliness, robustness and so
    11·1 answer
  • Which of the following are drivers of machine learning growth?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!