What is Java and what are its main features?
Java SE
Java EE
Java ME
Explain the JVM (Java Virtual Machine) and its role in Java programming.
What are the primitive data types in Java
What are the reference data types in Java?
class
a class is a blueprint or template that defines the structure and behavior of objects.
It specifies the:
1. properties (fields)
2. and actions (methods) that objects of that class can possess.
object
inheritance
What is the purpose of the “static” keyword in Java?
How do you create and use an array in Java?
For Example:
int[] numbers = new int[5];
or
int[] numbers = {1, 2, 3, 4, 5};Method Overloading
Method Overriding
How do you handle exceptions in Java?
Checked Exceptions
Unchecked Exceptions
abstract classes
interface
How many interfaces can a class implement?
multiple
How many abstract classes can a class extend?
one
What is a constructor?
For Example:
public class Person {
private String name;
public Person(String name) {
this.name = name;
}
}
Person person = new Person("John");What is the purpose of the “final” keyword in Java?
What happens when you use the new keyword to create a string object (i.e. String str = new String(“Hello”))?