JAVA QUESTION BANK
JAVA QUESTION BANK
Java is a high level, general purpose, object oriented programming language developed by Sun
Microsystems it is a platform independent used to create applications for computers, mobile devices,
and web applications.
Features:
1. Simple – Java is easy to learn because it removes complex features like pointers and manual
memory management.
2. Object-Oriented – Java follows an object-based approach (using classes and objects) to organize
code efficiently.
3. Platform-Independent – Java programs run on any operating system using the Java Virtual
Machine (JVM) ("Write Once, Run Anywhere").
4. Secure – Java provides security features like bytecode verification and no direct memory access,
making it safer from viruses.
5. Robust – Java has strong memory management and automatic error handling, reducing system
crashes.
6. Multithreading – It supports running multiple tasks simultaneously (like playing music while
downloading a file).
7. High Performance – Though slower than C++, Java uses Just-In-Time (JIT) compilation to improve
speed.
8. Distributed – Java supports network-based applications, making it ideal for web development.
9. Dynamic – Java can adapt to changes and update classes without stopping the program.
Q2. Difference between C++ and JAVA.
3. Explain JDK, JRE, JVM in details with Diagrammatic representation.
JDK (Java Development Kit)
The JDK is a software development kit that provides the environment to develop and execute the java
application. It includes two things:
Working of JDK
The JDK enables the development and execution of Java programs. Consider the following process:
Java Source File (e.g., Example.java): You write the Java program in a source file.
Compilation: The source file is compiled by the Java Compiler (part of JDK) into bytecode, which
is stored in a .class file (e.g. example.class)
Execution: The bytecode is executed by the JVM (Java Virtual Machine), which interprets the
bytecode and runs the Java program.
1. Loading
2. Linking
3. Initialization
Q4. Explain operators in java.
Q5. Explain keywords and control statement in java.
CONTROL STATEMENTS IN JAVA :
Q6. What is method and Constructor in java.
TYPES OF CONSTURCTOR:
1. Default Constructor
2. No argument constructor
3. Parameterised Constructor
Q7. What is inheritance explain its types with example.