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
What landforms are likely to form at this boundary
Paha777 [63]
<span>Landforms that could be created at convergent boundaries would consist of: volcanoes, mountains, trenches, volcanic islands, and even deserts could result from effects of converging boundaries. The landforms are mountains.</span>
3 0
3 years ago
True or false
Semmy [17]
It’s false I hope this helped you
3 0
2 years ago
Write a function transpose(matrix) that returns the transpose of the input matrix, which is represented as a list of lists. Reca
mariarad [96]

Answer:you eat

Explanation:yea

4 0
2 years ago
Which of the following types does the Java programming language support?
gtnhenbr [62]

Answer:

The correct answer for the given question is option(b) i. e "Integer" and option(c) i.e "Object".

Explanation:

The  Integer is a wrapper class for int data type in the java programming language, The integer provides more flexibility in storing the data and manipulating the data .

The syntax of using Integer type is given below

Integer variable_name = new Integer("value");

For example

Integer a1 = new Integer("12") ;

Object is the class  in java programming language which is present in java.lang package. Object also describe the return type of the java constructor.

4 0
3 years ago
Read 2 more answers
How can you change your mindset ? What are some fears you have had to overcome related to school ?
zavuch27 [327]
You have to change your point of view completely. You have to learn to leave bad habits and replace with new. Some fears include that you will be scared no one will like you or that you won't do good in school.

Hope that helps
5 0
3 years ago
Other questions:
  • Search engines enable you to
    13·2 answers
  • What is the function of the capsid? it allows a virus to live independently. it is composed of genetic material. it destroys the
    12·2 answers
  • Jim has to send an email to his boss requesting medical leave. in which field will Jim type the purpose of his email?​
    8·2 answers
  • ____ is a bundled set of communications services, including internet, telephone, and tv, that operates over a total fiber-optic
    5·1 answer
  • When you gather primary or secondary data, what part of the market information management process are you participating in?
    8·1 answer
  • The ________letter of the first word in the Complimentary Closing has a capital letter, everything else is keyed in lower case o
    8·1 answer
  • Write a class called Person that has two data members - the person's name and age. It should have an init method that takes two
    12·1 answer
  • Consider a DataFrame named df with columns named P2010, P2011, P2012, P2013, 2014 and P2015 containing float values. We want to
    9·1 answer
  • 1. Which of the following cables are used in networking? Check all that apply.
    8·2 answers
  • Caps lock key is used to type alphabets. _________​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!