PLZ help with the following IN JAVA Given the following Which line of code will instantiate an InnerCatobject if inserted after the creation of animal? a)InnerCatcat = animal.newInnerCat(); b)Animal.InnerCatcat = new animal.InnerCat(); c)InnerCatcat = this.newInnerCat(); d)InnerCatcat = new Animal.InnerCat();

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 20RQ
icon
Related questions
Question

PLZ help with the following IN JAVA

Given the following

Which line of code will instantiate an InnerCatobject if inserted after the creation of animal?

a)InnerCatcat = animal.newInnerCat();

b)Animal.InnerCatcat = new animal.InnerCat();

c)InnerCatcat = this.newInnerCat();

d)InnerCatcat = new Animal.InnerCat();

 

Discuss the classes in this question and explain why the other options are incorrect.

public class Animal {
private class InnerCat{
}
public static void main(String args) {
w
Animal animal= new Animal ();
//Possible choices:
//InnerCatcat
//Animal. InnerCatcat =
animal.newInnerCat();
wwwm
new animal.InnerCat();
//InnerCatcat
this.newInnerCat();
//InnerCatcat
new Animal.InnerCat();
www
wwww w
}
Transcribed Image Text:public class Animal { private class InnerCat{ } public static void main(String args) { w Animal animal= new Animal (); //Possible choices: //InnerCatcat //Animal. InnerCatcat = animal.newInnerCat(); wwwm new animal.InnerCat(); //InnerCatcat this.newInnerCat(); //InnerCatcat new Animal.InnerCat(); www wwww w }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT