Question: Please answer quickly 1- Given the following code snippet: public void displayV3(char init) { newChar=init; ActionListener displayer =new ActionListener() { public void actionPerformed(ActionEvent e) {
Please answer quickly
1-
Given the following code snippet:
public void displayV3(char init)
{
newChar=init;
ActionListener displayer =new ActionListener() {
public void actionPerformed(ActionEvent e) {
newChar++;
System.out.println("New Character: " + newChar);
}
};
Timer t=new Timer(1000, displayer);
t.start();
}
We have --------------------------------------- defined in the method named displayV3(char init).
a.
None of these
b.
One method local inner class
c.
No inner classes
d.
One anonymous inner class
2-
Which of the following is true about the anonymous inner class?
Select one:
a.
It has a fixed class name
b.
Objects can't be created
c.
It has only methods
d.
It has no class name
3-
You can use the following method header to override the equals method in Object class:
public boolean equals(Object obj)
Select one:
True
False
4-
Abstract classes can not be instantiated.
Select one:
True
False
5-
All of the following methods can be defined in one single interface:
default void printContent(T[] objects)
{
for(T t:objects)
{
System.out.println(t.toString());
}
}
default void printContent(ArrayList
{
for(T t:objects)
{
System.out.println(t.toString());
}
}
default void printContent(HashMap
{
for(HashMap.Entry
{
System.out.println("Key = " + entries.getKey() + " , Value = " + entries.getValue());
}
}
Select one:
True
False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
