_JAVA_ques
_JAVA_ques
JAVA ques 1
What if the static modifier is removed from the main method?
The program will not run as the JVM cannot invoke a non-static method.
No, this refers to the current instance, and static members belong to the
class.
JAVA ques 2
Abstract classes allow method implementations; interfaces allow multiple
inheritance and have all methods as abstract by default (before Java 8).
A class can contain both concrete and abstract methods, while an interface
only contains abstract methods (before Java 8).
JAVA ques 3
Difference between exception and error?
Exceptions can be recovered from; errors generally cannot.
Examples of exceptions:
NullPointerException
ArrayIndexOutOfBoundsException
java.lang.Exception .
What is a thread?
A thread is the smallest unit of a process.
JAVA ques 4
Methods for threads:
JAVA ques 5
Method used to register a thread in a thread scheduler?
The start() method.
No, the signature must include String[] args for the JVM to recognize it.
Refers to the parent class and can access its methods, variables, and
constructors.
What is JVM?
The Java Virtual Machine executes Java bytecode.
What is JDK?
The Java Development Kit contains tools and libraries for Java development.
args) ).
JAVA ques 6
It is allowed, but the JVM ignores duplicates.
Features of Java:
Object-oriented
Platform-independent
Multithreaded
JAVA ques 7