0% found this document useful (0 votes)
2 views

JAVA QUESTION BANK

Java is a high-level, object-oriented programming language developed by Sun Microsystems, known for its simplicity, platform independence, and robust security features. It includes tools like JDK for development, JRE for running applications, and JVM for executing Java programs. Key features of Java include multithreading, dynamic adaptability, and strong memory management.

Uploaded by

sakshihuple
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

JAVA QUESTION BANK

Java is a high-level, object-oriented programming language developed by Sun Microsystems, known for its simplicity, platform independence, and robust security features. It includes tools like JDK for development, JRE for running applications, and JVM for executing Java programs. Key features of Java include multithreading, dynamic adaptability, and strong memory management.

Uploaded by

sakshihuple
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Q1. What is Java? Write its features.

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:

Development Tools (to provide an environment to develop your java programs)


JRE (to execute your java program)

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.

JRE ((Java Runtime Environment)


The JRE is an installation package that provides an environment to only run(not develop) the Java
program (or application) onto your machine. JRE is only used by those who only want to run Java
programs that are end-users of your system.

JVM (Java Virtual Machine)


The JVM is a very important part of both JDK and JRE because it is contained or inbuilt in both. Whatever
Java program you run using JRE or JDK goes into JVM and JVM is responsible for executing the java
program line by line, hence it is also known as an interpreter.
Working of JVM:
It is mainly responsible for three activities.

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.

You might also like