Question: This is Java Programing Question 2: Multiple Selection Questions (14 points): .01) Which of the following statements about constructors are true? Check all that apply.
Question 2: Multiple Selection Questions (14 points): .01) Which of the following statements about constructors are true? Check all that apply. o A constructor is declared without a return type. O A constructor is the code that is called when you use the 'new' keyword. A constructor is a special method that creates an object and initializes its state. O A constructor wastes memory in the computer so it should be used sparingly. O A constructor can be used instead of fields to represent the data inside a class. O A class can have many methods but only one constructor. O Constructors are considered bad programming style and should be avoided. .02) What is the meaning of the keyword 'this', and how can the keyword be used? Check all that apply. 0 It refers to the object on which a method or constructor has been called (sometimes called the "implicit parameter"). o It can be used to call the object's methods. It is used to call one constructor from another. o It can be used to access or set an object's field values 0 It is required when a class has more than one constructor. 0 It is used when one object wants to access data from a second object. o It is used in conjunction with the 'that' keyword when the programmer wants to write a parallel "this and that" algorithm. .03) Consider the following classes: public class Vehicle {...} public class Car extends Vehicle {...} public class SUV extends Car {...} Which of the following are legal statements? Check all that apply. o Vehicle v = new SUV); o Car c = new SUV(); o Vehicle v = new Car(); o SUV S = new SUV(); 0 Car c = new Vehicle(); o SUV S = new Car()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
