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
The company that you work for has recently had a security breech. During the recover and assessment, it was discovered that the
mars1129 [50]

Answer:

I recommend Digital Certification of User through trusted certification Authority, who is requesting to access the company website through VPN to make sure the identity of the user.

Explanation:

Digital Certificate is the type of identity key or certificate that is assigned to the users as per their request. It is a unique number that is assigned to the user to ensure the authentication that Who are you. It is same like our identity card number that shows our identity to someone as per requirement.

These certificates are issued by certification organizations that are registered or trusted. If the users are using VPN on their devices to access some website that may not be a trusted user or a malware that can hurt the company by breaching the security protocols. So, some companies didn't allow untrusted users to websites.

<em>Therefore, I recommend to my company that, they should ensure that the users that are trying to access the website through VPN must have some digital Certificate from trusted certification authority to ensure the identity of the users.</em>

<em />

6 0
3 years ago
Which topology connects all the computers in a circular pattern
Nimfa-mama [501]
You have to give us the answer options kiddo!
5 0
2 years ago
Read 2 more answers
What is the function of control unit? in computer. <br>​
ycow [4]

regulates and integrates the operations of the computer. It selects and retrieves instructions from the main memory in proper sequence and interprets them

8 0
2 years ago
Compare and contrast between first and second generation of computer<br>​
noname [10]
Frist gen of computers took forever to load and would crash if someone els in the house picked up the phone now adays are computers are in our pockets. There our phones and they rarely if ever crash
8 0
2 years ago
if you cannot connect to the internet on a laptop even though the laptop says your connected what do you do​
vredina [299]

Answer: restart your computer.

Explanation: Restart your computer to clear up temporary software glitches and try connecting again. Check whether your WiFi is turned on or enabled on your device. Most laptops have a WiFi button or switch which, if turned off, could result in no internet access. Reposition your router or computer.

3 0
3 years ago
Other questions:
  • ____ are systems in which queues of objects are waiting to be served by various servers
    5·1 answer
  • What is a constructor? Why would you include a constructor in a class?
    6·1 answer
  • Thomas drew a rectangle with an area of 6 square cm what is the greatest possible perimeter of this rectangle
    5·1 answer
  • You must. place a child in a federally approved child restraint device. if the child is
    5·2 answers
  • Sales management wants a small subset of users with different profiles and roles to be able to view all data for compliance purp
    7·1 answer
  • The full meaning of ENIAC,ABACUS,EDVAC,EDSAC<br>and explain ​
    7·1 answer
  • Which support function under Tech Mahindra is governing data privacy and protection related requirements
    15·1 answer
  • A table of contents does not _____ automatically [customize table of contents]
    6·1 answer
  • A monitor is an output device. Which of the following is not a type of monitor? *
    11·1 answer
  • "write a program to play and score the paper-rock-scissor game. each of two users types in either p, r, or s. the program then a
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!