Which method will be executed as a result

Assignment Help Computer Engineering
Reference no: EM132218401

Answer the following Question :

Question 1 : A protected member of a class may be directly accessed by
Select one:
a. Methods of the same class
b. Methods of a subclass
c. Methods in the same package
d. All of these

Question 2 : A subclass class can directly access
Select one:
a. All members of the superclass class
b. Only public and private members of the superclass class
c. Only protected and private members of the superclass class
d. Only public and protected members of the superclass class

Question 3 : All fields declared in an interface
Select one:
a. Are final and static
b. Have protected access
c. Must be initialized in the class implementing the interface
d. Have private access

Question 4 : Given the following code which of the following is true?

Select one:
a. ClassA must override each method in ClassB
b. ClassB must override each method in ClassA
c. ClassB is derived from ClassA
d. ClassA is derived from ClassB

Question 5 : If a class contains an abstract method,
Select one:
a. You must create an instance of the class
b. The method will have only a header, but not a body, and end with a semicolon
c. The method cannot be overridden in derived classes
d. All of these

Question 6 : If a subclass constructor does not explicitly call a superclass constructor,
Select one:
a. It must include the code necessary to initialize the superclass fields
b. The superclass fields will be set to the default values for their data types
c. Java will automatically call the superclass's default constructor immediately after the code in the subclass's constructor executes
d. Java will automatically call the superclass's default constructor just before the code in the subclass's constructor executes

Question 7 : If a superclass does not have a default constructor,
Select one:
a. Then a class that inherits from it, must initialize the superclass values
b. Then a class that inherits from it, must call one of the constructors that the superclass does have
c. Then a class that inherits from it, does not inherit the data member fields from the superclass
d. Then a class that inherits from it, must contain the default constructor for the superclass

Question 8 : If you do not provide an access specifier for a class member, the class member is given this access by default.
Select one:
a. Private
b. Public
c. Protected
d. Package

Question 9 : If ClassA is derived from ClassB, then
Select one:
a. Public and private members of ClassB are public and private, respectively, in ClassA
b. Public members in ClassB are public in ClassA, but private members in ClassB cannot be directly accessed in ClassA
c. Neither public or private members in ClassB can be directly accessed in ClassA
d. Private members in ClassB are changed to protected members in ClassA

Question 10 : In a class hierarchy
Select one:
a. The more general classes are toward the bottom of the tree and the more specialized are toward the top
b. The more general classes are toward the top of the tree and the more specialized are toward the bottom
c. The more general classes are toward the left of the tree and the more specialized are toward the right
d. The more general classes are toward the right of the tree and the more specialized are toward the left

Question 11 : In an interface all methods have
Select one:
a. Private access
b. Protected access
c. Public access
d. Packaged access

Question 12 : In the following statement, which is the interface?

Select one:
a. ClassA
b. ClassB
c. ClassC
d. Cannot tell

Question 13 : In the following statement, which is the subclass?

Select one:
a. ClassA
b. ClassB
c. ClassC
d. Cannot tell

Question 14 : In the following statement, which is the superclass?

Select one:
a. ClassA
b. ClassB
c. ClassC
d. Cannot tell

Question 15 : In UML diagrams, inheritance is shown
Select one:
a. With a line that has an open arrowhead at one end that points to the superclass
b. With a line that has an open arrowhead at one end that points to the subclass
c. With a line that has a closed arrowhead at one end that points to the superclass
d. With a line that has a closed arrowhead at one end that points to the subclass

Question 16 : Look at the following code and determine what the call to super will do.

Select one:
a. This cannot be determined form the code
b. It will call the constructor of ClassA that receives an integer as an argument
c. It will call the method super and pass the value 40 to it as an argument
d. The method super will have to be defined before we can say what will happen

Question 17 : Look at the following code. The method in line ________ will override the method in line ________.

Select one:
a. 4, 10
b. 5, 11
c. 10, 4
d. 11, 5

Question 18 : Look at the following code. What is missing from ClassA?

Select one:
a. It does not override methodA
b. It does not have a constructor
c. It does not overload methodA
d. It is a complete class

Question 19 : Look at the following code. Which line has an error?

Select one:
a. 1
b. 2
c. 3
d. 4

Question 20 : Look at the following code.

Which method will be executed as a result of the following statements?

Select one:
a. Line 4
b. Line 9
c. Line 14
d. This is an error and will cause the program to crash

Question 21 : Protected members are
Select one:
a. Not quite private
b. Not quite public
c. Both Not quite private and Not quite public
d. Neither Not quite private nor Not quite public

Question 22 : What is wrong with the following code?

Select one:
a. Nothing is wrong with the code
b. The method super is not defined
c. The call to the method super must be the first statement in the constructor
d. No values may be passed to super

Question 23 : Which of the following statements declares Salaried as a subclass of PayType?
Select one:
a. public class Salaried extends PayType
b. public class Salaried implements PayType
c. public class Salaried derivedFrom(Paytype)
d. public class PayType derives Salaried

Question 24 : Every class has a toString method and an equal's method inherited from the Object class.
Select one:
True
False

Question 25 : If a method in a subclass has the same signature as a method in the superclass, the subclass method overloads the superclass method.
Select one:
True
False

Reference no: EM132218401

Questions Cloud

Identify the different target markets : Identify the different target markets and, using segmentation characteristics and any other applicable concepts, evaluate and explain your reasons.
Write matlab code that will start with a positive integer : Write MATLAB code that will start with a positive integer and run through this process until a 1 is reached.
Accept a string parameter representing a file name : Write a function named input_stats that accepts a string parameter representing a file name, then opens/reads that file's contents and prints information.
To which namespace does the file class belong : Which of the following methods could be used to retrieve a decimal value from a binary file? To which namespace does the File class belong?
Which method will be executed as a result : If a method in a subclass has the same signature as a method in the superclass, the subclass method overloads the superclass method.
What is the global cpi for each implementation : What is the global CPI for each implementation? Find the clock cycles required in both cases.
Post a working approach for the topic you chose : Read: "Topics and Approaches to the Literary Essay" in the Resources folder. Choose one of the topics provided for you, or email the professor for approval.
What kind of behavior and characteristics do other expect : Write at least a full paragraph (9 sentences) describing Staples' socially prescribed role as an African American male. In other words, what kind of behavior.
Critically reflect on your experience of leadership theory : Over the years, leadership has emerged as a significant topic of academic and practitioner debate. Critically reflect on your experience of leadership theory.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Which of philosophical position on the question of human

Which of philosophical position on the question of human freedom do you find most persuasive, which do you find least persuasive? Why?

  Evaluating the post fixed expression

Approximate the post fixed expression a) Initialize an empty stack. While there exist more symbols within postfix string { b) If token is an operand, push it onto the stack. If token is an operator

  Organizational information systems to a company plan

How are organizational information systems related to a company strategy? How does plan affect the information systems a company develops and uses.

  Make a database in ms access

create a database in MS Access and a set of reports to support a business . The following business rules should be addressed.

  Choose third-party control available for visual basic.net

choose a third-party control available for Visual Basic.NET. Discuss how this control is used in an application. What are the advantages and disadvantages of using third-party controls in your applications.

  Extract the number of frames and frame size

For each frame number of blocks containing moving object are checked to satisfy H/W ratio depending on area covered by camera.

  Write a user-friendly user interface

The intent here is not to write a user-friendly user interface; what you're actually doing is building a program that we can test automatically

  Identify the positive and negative aspects of the website

COIS 12036 Human Computer Interaction Provide an overview and description of the nominated website and identify and elaborate the main feature or features of the website.

  Write least-squares regression equation for airports costs

Write the least-squares regression equation for the airport's costs. Predict the airport's costs during a month when 1,500 flights originate at the airport.

  Find significant inversions in the input sequence

offer an O(n*log(n)) algorithm to count the number of significant inversions in the input sequence.

  Define trade-off between internal cohesion and external ties

Consider the different teams presented in your reading assignment. How do the teams manage their team boundaries? What are the trade-offs between internal.

  Prompt the user for the number of guests in the party

Prompts the user for the price of the prix fixe menu choice. The program should then prompt the user for the number of guests in the party.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd