Abstract Classes and Implementing Interfaces
Description: Abstract Classes and Implementing Interfaces | |
Number of Questions: 15 | |
Created by: Aliensbrain Bot | |
Tags: Abstract Classes and Implementing Interfaces Java/Oracle /C/C++ Java Basics of Java Programming |
______________ collection class extends the AbstractList for a collection that uses sequential access, rather than the random access of its elements.
Which of the following classes implements a dynamic array by extending the AbstractList?
When we implement the Runnable interface in a class, then we must define _____ method.
Which of the following statements regarding the packages is correct in Java?
Which of the following interfaces in Java servlets indicates that the servlet is thread safe?
Which of the following methods in Map.Entry interface in Java returns the value for the map entry?
Which of the following methods, declared by Map interface, returns a Set that contains the entries in the Map interface?
In Java, which of the following is implemented by extending AbstractSequentialList class?
Which of the following statements are true?
- The Iterator interface declares only three methods: hasNext, next and remove.
- The ListIterator interface extends both the List and Iterator interfaces.
- The ListIterator interface provides forward and backward iteration capabilities.
- The ListIterator interface provides the ability to modify the List during iteration.
- The ListIterator interface provides the ability to determine its position in the List.
Which of the following in collection classes in Java implements a set stored in a tree and also extends AbstractSet class?
Which of the following methods in ListIterator class returns true if there is a next element otherwise returns false?
What will be the output of the program?
interface Count {
short counter = 0;
void countUp();
}
public class TestCount implements Count {
public static void main(String[] args) {
TestCount t = new TestCount();
t.countUp();
}
public void countUp() {
for (int x = 6; x > counter; x--, ++counter) /* Line 10 */ {
System.out.print(" " + counter);
}
}
}
What will be the output of the program?
public abstract class AbstractTest {
public int getNum() {
return 45;
}
public abstract class Bar {
public int getNum() {
return 38;
}
}
public static void main(String[] args) {
AbstractTest t = new AbstractTest() {
public int getNum() {
return 22;
}
};
AbstractTest.Bar f = t.new Bar() {
public int getNum() {
return 57;
}
};
System.out.println(f.getNum() + +t.getNum());
}
}
___________ interface allows a designer to provide a graphical user interface through which bean may be configured.
Which of the following interfaces in Java Beans API allows a designer to specify information about the properties, events and methods of a bean?