1. What happens if a Java interface specifies a particular method signature, and
ID: 3751356 • Letter: 1
Question
1. What happens if a Java interface specifies a particular method signature, and a class that implements the interface provides a different signature for that method?
A.run time error
B.exception is thrown
C.syntax error
D.unmatched arguments are null
E.nothing
Question 2
The following sequence of operations essentially leaves a stack unchanged.
A.pop followed by push
B.pop followed by top
C.push followed by pop
D.push followed by top
E.top followed by push
Question 3
In the following command sequence, numbered blocks are pushed and popped from a stack. Suppose that every time a block is popped, its numerical value is printed. What is the sequence of values that are printed? Assume you begin with an empty stack: push block5; push block7; pop; pop; push block2; pop; push block1; pop; push block8; pop;
A.8 1 2 7 5
B.7 5 2 1 8
C.5 7 2 1 8
D.7 5 8 1 2
E.None of these is correct.
Question 4
We deal with ADTs on three levels. On which level do we deal with the “how” questions, as in how do we represent the attributes and fulfill the responsibilities of the ADT?
A.application (or user, client, external)
B.machine (or assembly)
C.abstract (or logical)
D.primitive (or language dependent)
E.implementation (or concrete, internal)
Question 5
An abstraction of a system is a model of the system that includes all the details about the system.
A.True
B.False
Question 6
UML diagrams are not a form of abstraction, since they hide details and only allow us to concentrate on the major design components.
A.True
B.False
Question 7
An abstract method must not have any comments.
A.True
B.False
Question 8
In a non-empty stack, the item that has been in the stack the longest is at the bottom of the stack.
A.True
B.False
Explanation / Answer
Answer)
1) C) It gives a syntax error.
2) C) Push followed up by pop.
5) False
6) True
7) True
As per Chegg policy, a minimum of 1 question can be done. We did 5.
Hit like if you find the answer useful. :)
Hope this answer helps. Thanks
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.