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

  Evaluate the three standard organizations including ieee

Evaluate the three standard organizations including IEEE, ISO, and ANSI to determine the most important for communication technology.

  Applications of the internet to tourism and hospitality

What are the applications of the internet to tourism and hospitality? The response must be typed, single spaced.

  Explain the methods to reduce the frustrations

Suggest at least three (3) methods to reduce the frustrations among the disabled population and how this population can be better served.

  What horizontal row the chip is sitting in

What horizontal row the chip is sitting in. The chip may move in any direction on the board: horizontally, vertically, or diagonally.

  Make a program to prints out the even integers

Write a c++ program that prints out the even integers between 2 and 100.

  How well did you do on the test and what did you learn

One of the key topics we have been learning about is ensuring that all users are aware of security threats. Email phishing is a common threat that a user may.

  Programming assignment

Build a Dictionary on top of a Bag built on top of an

  Explain the networking concepts in detail

The purpose of this assignment is to familiarize students with a few networking concepts that are frequently utilized by IT professionals.

  Compute and return the number of strings of a as and b bs

Compute and return number of strings of a A's, b B's, and c C's. For example, f(1, 2, 1) returns 12 because there are 12 strings made up of 1 A, 2 B's and 1 C.

  Write a function that asks for the users first and last name

Write a function that asks for the user's first, middle, and last names. The names should be stored in three different character arrays.

  Question regarding the white rabbit

A magician has a hat that holds two rabbits. One rabbit is black and the other is white. In his last 16 performances he has randomly pulled the black rabbit from the hat 16 times. The probability that he will pull the white rabbit from the hat in ..

  Xpath and xslt transformation

Explain the context in XPath. Explain at least three things you will require to perform an XSLT transformation.

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