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
BigorU [14]
3 years ago
6

Consider the classes below, declared in the same file: class A { int a; public A() { ​ a = 7; } } class B extends A { int b; pub

lic B() { ​ b = 8; } } Which of the statements below is false? Group of answer choices After the constructor for class B executes, the variable a will have the value 7. A reference of type A can be treated as a reference of type B. Both variables a and b are instance variables. After the constructor for class B executes, the variable b will have the value 8.
Computers and Technology
1 answer:
DiKsa [7]3 years ago
4 0

Answer:

2. <em>A reference of type A can be treated as a reference of type B</em> - False

Base class or its objects are not related to their derived class (or its objects).

Explanation:

class A {

   int a;

   public A() {

       a = 7;

   }

}

class B extends A {

   int b;

   public B() {

       b = 8;

   }

}

///////////////////////////////////////////////////////////////////////////////////////////////////////

1. <em>After the constructor for class B executes, the variable a will have the value 7 </em>- True.

When an object of a derived class is declared, the constructor of base class is called before the constructor of derived class (is called).

3. <em>Both variables a and b are instance variables </em>- True.

Classes can have instance, or member, variables and methods.

4.<em> After the constructor for class B executes, the variable b will have the value 8</em> - True.

When object of class B is declared, its constructor was called, which initialized variable b to 8.

You might be interested in
Which is the most portable memory media? Mention its features in detail.
scZoUnD [109]

Answer:

Flashdrive

Increased Durability. Unlike traditional hard-disk drives, flash drives lack moving parts. ...

Maximum Portability. ...

Plenty of Storage Capacity. ...

Fast Transfer Speeds. ...

Compatibility with Many Devices. ...

Use Flash Drives as Promotional Materials.

5 0
3 years ago
WHAT ARE THE RISK OF DUST​
Step2247 [10]

Answer:

over heating

Explanation:

in computers dust acts as a blanket which traps heat, excessive heat causes components to burn up and short out

3 0
3 years ago
After a webcast is completed there are no files left on your computer.
astra-53 [7]
What are you askinggggggggggg

7 0
3 years ago
Which company invented the Six Sigma process?
horsena [70]

Answer:

Motorola

Explanation:

5 0
3 years ago
Read 2 more answers
In Outlook 2016, what happens when users begin to type in the To field the name of an email recipient to whom they frequently se
tino4ka555 [31]

Answer:

the email will automatically be listed

8 0
3 years ago
Read 2 more answers
Other questions:
  • The definition of an "analog device" is that it is a type of _____.
    5·1 answer
  • Write a program that generates two 3x3 matrices, A and B, withrandom values in the range [1, 100] and calculates the expression½
    11·1 answer
  • Which of these jobs would be most appropriate for someone who majors in information technology? managing a database for a large
    6·2 answers
  • Terminal emulation, especially the unprotected ____________________ protocol, should be blocked from any access to all internal
    9·1 answer
  • What is technology? Technology advantages and disadvantages
    11·1 answer
  • Write the WordSandwich method allSandwiches. This method creates and returns a new array of String objects as follows. Each elem
    13·1 answer
  • Write a python program to accept a number and check whether it is divisible by 4 or not​
    10·1 answer
  • 1. Which sentence best expresses the main idea
    12·1 answer
  • Many bookstores have closed since the rise of the Internet. What type of
    11·1 answer
  • Compose an e-mail to your coworker Adam that describes how to add a photograph to a slide.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!