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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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