Professional Documents
Culture Documents
Java Interview Questions (Plain)
Java Interview Questions (Plain)
java”
package interview;
import java.sql.Date;
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Invoice)) {
return false;
} else {
Invoice other = (Invoice) obj;
return date == other.date
&& description == other.description
&& amount == other.amount
&& currency == other.currency;
}
}
}
Single Choice Questions
7. What is the value of total after executing the following code snippet?
int meal = 5;
int tip = 2;
● 1
● 2
● 3
● 6
Preparation for Interactive Part/Discussion
1. What is Deadlock?
2. How do you stop a thread in java?
3. What is the difference between the Thread class and Runnable
interface for creating a Thread?
4. What is a race condition?
5. What are Generics? What are the benefits of Generics?
6. What is the difference between Comparable and Comparator
interface?
7. What is the difference between HashSet and HashMap?