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
hichkok12 [17]
3 years ago
12

What is the output of the following code? public class Test { public static void main(String[] args) { new Person().printPerson(

); new Student().printPerson(); } } class Student extends Person { private String getInfo() { return "Student"; } } class Person { private String getInfo() { return "Person"; } public void printPerson() { System.out.println(getInfo()); } }
Computers and Technology
1 answer:
fredd [130]3 years ago
3 0

Answer:

The output of the given question is :

Person

Person

Explanation:

Following are the description of Statements

  • The new Person().printPerson(); calling the function of printPerson() of the class Person so it returns the Person in the console window.
  • The new Student().printPerson(); calling the function of printPerson() of the class student .The student inherits the class Person So control will moves to the class it executed the statement inside the Person class So it executed the function public void printPerson() of the Person class so it also returns the Person String and execution of program become stops
You might be interested in
LISTEN I NEED EVERY SINGLE BRAINLY USER TO RE POST THIS THERE IS A USER WHO JUST SAID THEY ARE GOING TO KILL THEMSELVES PLEASE C
Over [174]
WHAT IS THE NAME OF THE BRAINLY USER
7 0
3 years ago
Read 2 more answers
How would you identify communication equipment?
eimsori [14]

Answer

Explanation:

There should be more context to this question but I would say there is a variety of things that could be seen as communication equipment, such as email, telephone, voice message, through mail.

6 0
3 years ago
Create a program named SalesTaxDemo that declares an array of 10 Sale objects. Prompt the user for data for each object and disp
podryga [215]
Jkisythrhajkdhahdbshehe
7 0
3 years ago
Consider a multilevel computer in which all levels are different. Each level has instructions that are m times as powerful as th
Leona [35]

Answer:

Following are the responses to the given question:

Explanation:

Its machine slows for each further level of evaluation by an n/m factor. Therefore are the times for implementation for levels 2, 3, and 4 are \frac{kn}{m} \ and\  \frac{kn^2}{m^2} \ and \ \frac{kn^3}{m^3}.

So, the level values are:

level \ 2 = \frac{kn}{m}\\\\level \ 3 = \frac{kn^2}{m^2}\\\\level \ 4 = \frac{kn^2}{m^2}\\\\

7 0
3 years ago
It is early in the year, and Keesha would like to start saving money for next year’s holiday presents. What type of account shou
kupik [55]
Money market account 
4 0
3 years ago
Other questions:
  • All phones must have a way of making and then terminating a connection to the phone network; however the exact procedure for doi
    6·1 answer
  • Write a for loop to verify that your function is correctly returning the expected output for the radius values between 0 and 11.
    14·1 answer
  • Given two double variables, best value and second best value, write some code that swaps their values. declare any additional va
    13·1 answer
  • You interact with a program through which of the following, thereby controlling how you enter data and instructions and how info
    5·2 answers
  • Which of the following is an example of a logic error?
    9·2 answers
  • Joe has just started the Security Module. He wants to get through it as quickly as possible and take the Quiz. As he clicks thro
    11·1 answer
  • 7. Which cipher is based on the clues of the physical factors, rather than the hardware or a software cryptosystem
    8·1 answer
  • - O conhecimento na Educação Física, normalmente passa do senso comum e vai para um conhecimento mais formal, ou seja, do conhec
    7·1 answer
  • Synthesize (15 points)
    13·1 answer
  • TASK 1. JUMBLE ME! Direction: Arrange the jumbled letters to form a word. 1. PEREAM 2. RRENT CU 3. METREMO H 4. TORSISER 5. TANC
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!