Question

In: Computer Science

1. when you create a class by making it inherit from another class, the new class...

1. when you create a class by making it inherit from another class, the new class automatically, contains the data fields and _____ of the original class

a. fonts

b. methods

c. class names

d. arrays

2. if a programming language does not support ________, the language is not considered object oriented

a. syntax

b. applets

c. loops

d. polymorphism

3. when you create a class and do not provide a ______, java automatically supplies you with a default one

a. constructor

b. argument

c. header

d. name

4. when tou employ ______, your data can be altered only by the methods you choose and only that you can control

a. virtual methods calls

b. polymorphism

c. information hiding

d. inlining

Solutions

Expert Solution

Answer:

1.Answer: Class names

Explanation:

Class contains fields and methods so when you inherit you will get both data fields and methods in child

2.Answer: polymorphism

Explanation:

Syntax, applets, loops are part of any programming language but polymorphism i.e. method overriding and method overriding is one of the basic concepts of object oriented language. And polymorphism can't be done in procedural
programming

3.Answer: constructor

Explanation:

Constructor is required to initialise the object and Arguments,headers and name of the classes are not used to initialise a object and they should be set according to the given problem statement.

4.Answer: information hiding

Explanation:

Information hiding is making the data members private,and you can only access that data from the member functions only ,by this we can prevent users from manipulating internal data of an object into inconsistent state.

*******************

Please give an Upvote if you found this answer helpful

******************


Related Solutions

1. Can you extend an abstract class? In what situation can you not inherit/extend a class?...
1. Can you extend an abstract class? In what situation can you not inherit/extend a class? 2. Can you still make it an abstract class if a class does not have any abstract methods?
1. Create a class Car with data: Name, Price, Production and properly methods. 2. Create another...
1. Create a class Car with data: Name, Price, Production and properly methods. 2. Create another class named GenericCar with a parameter of the T type. This class manages a collection of object T (may be LinkedList) named a. Implementing some methods for GenericCar: Add: add new item of T to a Display: display all items of a getSize: return the number item of a checkEmpty: check and return whether a is empty or not delete(int pos): remove the item...
To make class DressShirt inherit the functionality of both Clothing and Shirt (from previous question), the...
To make class DressShirt inherit the functionality of both Clothing and Shirt (from previous question), the class header would be: Group of answer choices public class DressShirt inherits Shirt, Clothing public class DressShirt inherits Shirt public class DressShirt extends Shirt public class DressShirt extends Shirt, Clothing If Shirt inherits Clothing, then Shirt has direct access to the ______ members of Clothing Group of answer choices public and protected public private protected private and protected Shirt inherits Clothing. What is the...
-------------- WRITE IN C# ------------------- Create two subclasses called outpatient and inpatient which inherit from the...
-------------- WRITE IN C# ------------------- Create two subclasses called outpatient and inpatient which inherit from the patient base class. The outpatient class has an additional data field called doctorOfficeID and the inpatient class has an additional data item called hospitalID. Write a main method that creates inpatient and outpatient objects. Sets data for these objects and display the data.
Create a new project ‘Clocky’ - Create a ‘ClockAlarm’ class Include 1 member – a List...
Create a new project ‘Clocky’ - Create a ‘ClockAlarm’ class Include 1 member – a List alarmTimes Create an accessor and mutator Create a method addAlarmTime which adds an alarm time to your list Create a method deleteAlarmTIme which removes an alarm time from your list Create a method – displayAlarmTimes which prints all alarm times in the list - Create a ‘Clock’ class - include at least 2 members - one member of Clock class needs to be private...
Step 1: Create a new Java project called Lab5.5. Step 2: Now create a new class...
Step 1: Create a new Java project called Lab5.5. Step 2: Now create a new class called aDLLNode. class aDLLNode { aDLLNode prev;    char data;    aDLLNode next; aDLLNode(char mydata) { // Constructor data = mydata; next = null;    prev = null;    } }; Step 3: In the main() function of the driver class (Lab5.5), instantiate an object of type aDLLNode and print the content of its class public static void main(String[] args) { System.out.println("-----------------------------------------");    System.out.println("--------Create...
In Java, create an abstract vehicle class. Create a Truck Class that Inherits from Vehicle Class....
In Java, create an abstract vehicle class. Create a Truck Class that Inherits from Vehicle Class. The vehicle class should contain at least 2 variables that could pertain to ANY vehicle and two methods. The truck class should contain 2 variables that only apply to trucks and one method. Create a console program that will instantiate a truck with provided member information then call one method from the truck and one method contained from the inherited vehicle class. Have these...
1. Please create a New Class with the Class Name: Class17Ex Please add the ten methods:...
1. Please create a New Class with the Class Name: Class17Ex Please add the ten methods: 1. numberOfStudents 2. getName 3. getStudentID 4. getCredits 5. getLoginName 6. getTime 7. getValue 8. getDisplayValue 9. sum 10. max Show Class17Ex.java file with full working please. Let me know if you have any questions.
You inherit $1000 from your Mother. 1) What do you do with the money? What do...
You inherit $1000 from your Mother. 1) What do you do with the money? What do you spend it on? Do you save any of it? 2) Calculate your MPS and MPC. Show your work. 3) Calculate your Multiplier.    Show your work. 4) What effect does your spending have on GDP - how much additional spending is credited?
1. Create a new Java project called L2 and a class named L2 2. Create a...
1. Create a new Java project called L2 and a class named L2 2. Create a second class called ArrayExaminer. 3. In the ArrayExaminer class declare the following instance variables: a. String named textFileName b. Array of 20 integers named numArray (Only do the 1st half of the declaration here: int [] numArray; ) c. Integer variable named largest d. Integer value named largestIndex 4. Add the following methods to this class: a. A constructor with one String parameter that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT