Question: JAVA thank you ~~~ 1 In the following numbers, we use (D) to denote ordinary decimal notation, and (H) to denote hexadecimal notation: FF (H)

JAVA thank you ~~~

1 In the following numbers, we use (D) to denote ordinary decimal notation, and (H) to denote hexadecimal notation:

 FF (H) 11 (H) 5 (D) 11 (D) 

Which of the following are the correct binary representation of these four numbers?

a
11111111 10001 101 1011
b
11111111 10001 101 11
c
11001100 10001000 101 1101
d
11001100 10001 101 1101

2 .Searching an array using a binary search (check all that apply):

a

... is usually faster for each search than a simple linear search.
b

... is usually slower for each search than a simple linear search.

c

... requires a pre-sorted array in order to work.

d

... requires more code and logic than a simple linear search.

3.

Consider this method definition:

 static int someRecMethod( int n ) { if ( n < 0 ) return -1; return someRecMethod( n + 1 ); } 

This method has the following problem -- or none (only one correct choice):

A Nothing is wrong; it has both an explicit case and a recursive case.
B It will sometimes return a -1 without error, and other times produce a runaway recursive call to itself resulting in a run-time error.
C It will always return the same number no matter what is passed in as an argument from the client.
D

It will always produce a runaway recursive call to itself resulting in a run-time error.

4.

Assume you are working inside the method definition of some instance method of class B - you are writing the statements that define this method. In order to call an instance method of a class Afrom inside this instance method of a class B (where B and A are unrelated by inheritance to one-another), you:

a ... must use an object of class B for dereferencing the method call.
B ... can call the method without any object used for dereferencing.
C ... must use an object of a third class, a base class of both class A and class B, for dereferencing.
D

... must use an object of class A for dereferencing the method call.

5.

Select the derived class method definitions that represent method or constructor chaining (i.e., calling the base class method or constructor from the (overriding) derived class method or constructor) There may be more than one correct answer.

A
class Sub extends Base { void methodX() { Base.methodX(); // other stuff } } 
B
class Sub extends Base { Sub() { super(); // other statements ... } } 
C
class Sub extends Base { void methodX() { super(); // other stuff } } 
d
class Sub extends Base { Sub() { Base(); } } 
E
class Sub extends Base { void methodX() { super.methodX(); // other stuff } } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!