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
coldgirl [10]
3 years ago
11

Consider the following classes: public class A { private int myNum; public A(int x) { myNum = x; } public int getNumber() { retu

rn myNum; } public String getLetters() { return "A"; } public String getMessage() { return this.getLetters() + "-" + this.getNumber(); } } public class AB extends A { public AB(int x) { super(x + 1); } public int getNumber() { return super.getNumber() + 1; } public String getLetters() { return "AB"; } } What is the output of the following code segment? A test = new AB(0); System.out.print(test.getMessage());
Computers and Technology
1 answer:
Lady bird [3.3K]3 years ago
7 0

Answer:

The output of the given code is "AB-2".

Explanation:

The description of the java program can be given as:

  • In this program firstly we define a class that is "A". In this class, we define a private integer variable that is "myNum" and parameterized constructor and pass an integer variable that is "x" and use a private variable to holds the constructor variable value.Then we define three function that is "getNumber(), getLetters() and getMessage()" this function we returns values.
  • Then we define another class that is "AB" which inherits the base class "A". In this class we define parameterized constructor and two methods that is "getNumber() and getLetters()". In the parameterized constructor and getNumber() method we use a super keyword that calls above(base class methods) and increases the value by 1. In getLetters() method we return value that is "AB".
  • In calling time we create a class object that is "test", and call the AB class and pass value 0 in the parameter, and call the getMessage() method.

That's why the output of this program is "AB-2".

You might be interested in
Rutherford concluded from his calculations that the volume of an atom is filled with protons, neutrons and electrons. is mostly
enyata [817]

Answer:

The answer is "is mostly empty space".

Explanation:

In the given question option numbers is defined, so the explanation to this question  as follows:

The volume of an element holds one mole at high temperatures. The nuclear mass is usually indicated by mole: cc/mol in the \ cm^3. It is also known as a quantity, in which the same molecule was the measured values based on atomic mass as well as the thickness of both, and certain alternatives were wrong which can be explained as follows:

  • atom doesn't fill the protons, neutrons, and electrons.
  • It can't revolve with outside atoms and electrons.

6 0
3 years ago
How serious are the risks to your computer security?
ASHA 777 [7]

The seriousness of  the risks to your computer security is not to be a severe one. This is because Computer security risks  are due to the handwork of  malware such as, bad software, that can infect a  computer, and make the hacker to destroy your files, steal your data, or even  have access to your system without one's knowledge or authorization.

<h3>What are the risk results for information and computer security?</h3>

The term “information security risk” is known to be those  damage that occurs due to  an attacks against IT systems. IT risk is made up of a wide range of potential events, such as data breaches, regulatory enforcement actions, financial costs, and a lot more.

Some Examples of malware are viruses, worms, ransomware, spyware, and a lot others.

Hence, The seriousness of  the risks to your computer security is not to be a severe one. This is because Computer security risks  are due to the handwork of  malware such as, bad software, that can infect a  computer, and make the hacker to destroy your files, steal your data, or even  have access to your system without one's knowledge or authorization.

Learn more about computer security from

brainly.com/question/12010892

#SPJ1

6 0
2 years ago
Which of the following is a quality of a mixed economy?
tekilochka [14]

Answer:

Image result for Which of the following is a quality of a mixed economy? 1. Businesses have complete control of what they import. 2. Individuals have complete control of what they export. 3.Leaders determine the wages of individuals without any input from businesses. 4. Government encourages free trade of specific products.

'One main characteristic of a mixed economy is the ownership of goods by both private and government/state-owned entities. Monopolies have the potential to occur in this type of economy, but the government closely monitors this. For the economy to be mixed, the government can control some parts but not all.

Explanation:

6 0
3 years ago
Brain of the computer system is called​
bagirrra123 [75]

Answer:

central processing unit in short form CPU :)

5 0
3 years ago
Read 2 more answers
question 7 packages installed in rstudio are called from cran. cran is an online archive with r packages and other r-related res
Ksenya-84 [330]

Packages installed in rstudio are called from cran. cran is an online archive with r packages and other r-related resources, is the true statement.

<h3>What are CRAN packages in R?</h3>

It comprises archives for both the most recent and prior versions of the R distribution, donated R packages, and documentation. It provides both source packages and pre-compiled binaries for Windows and macOS. there are more than 16,000 bundles available.

The version of R that is made available through CRAN is compatible with the integrated development environment for R, referred to as RStudio. All of the major systems support RStudio, which includes a variety of tools that boost productivity.

Thus, it is the true statement.

For more information about CRAN packages in R, click here:

brainly.com/question/10658169

#SPJ1

7 0
1 year ago
Other questions:
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • People with healthy media diets:
    12·1 answer
  • Tom is very curious as to whether terrorism is truly linked to levels of religiosity around the world. As such, he gathers data
    15·1 answer
  • I wanna start answering questions for people, but I don't quite know how. Can you help me?​
    13·1 answer
  • X = 19 y = 5 print (x % y)
    11·1 answer
  • To protect a computer, it is a good idea to install and frequently run
    6·2 answers
  • When you are almost done with your soup and want to get at the last little bit, how should you do this 2
    5·1 answer
  • Can include the 5-tuple information, which is the source and destination ip addresses, source and destination ports, protocols i
    9·1 answer
  • Write a java program to find the perimeter of a triangle with sides measuring 10cm, 14cm and 15 cm.
    8·1 answer
  • Copy the formula in cell M7 to the range M8:M15, and edit the copied formulas to return the value from the column indicated by t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!