Submitted by c-admin on Fri, 05/31/2019 - 05:59
What is the correct declaration for an abstract method 'add' accessible to any class, takes no arguments and returns nothing? (Use only one space between words)
Select 1 option
A. public void add();
B. abstract add();
C. abstract null add();
D. abstract public void add(){ }
E. abstract public void add() throws Exception;
Submitted by c-admin on Fri, 05/31/2019 - 05:58
Given the definitions of I and Klass, complete the definition of SubClass so that it extends from Klass and implements I.
Submitted by c-admin on Fri, 05/31/2019 - 05:54
Which of the given statements are correct for a method that overrides the following method:
public Set getSet(int a) {...}
Select 3 options
A. Its return type must be declared as Set.
B. It may return HashSet.
C. It can declare any Exception in throws clause
D. It can declare any RuntimeException in throws clause.
E. It can be abstract.
Submitted by c-admin on Fri, 05/31/2019 - 05:53
Given the following interface definition, which definitions are valid?
interface I1{
void setValue(String s);
String getValue(); }
Select 2 options
A. class A extends I1{
String s;
void setValue(String val) { s = val; }
String getValue() { return s; } }
B. interface I2 extends I1{
void analyse(); }
C. abstract class B implements I1{
int getValue(int i) { return 0; } }
D. interface I3 implements I1{
void perform_work(); }
Submitted by c-admin on Fri, 05/31/2019 - 05:52
Which one of these is a proper definition of a class Car that cannot be sub-classed?
Select 1 option
A. class Car { }
B. abstract class Car { }
C. native class Car { }
D. static class Car { }
E. final class Car { }
Pages