JAVA PROGRAMMING LANGUAGE
IMPORTANT QUESTIONS
1. Write Short notes about JFK, JRE, JVM.
JDK : JDK stands for Java Development Kit. It internally contains JRE and
JVM, where JRE stands for Java Runtime Environment and JVM stands for in
Java Virtual Machine, JDK provides all the tools to work with Java language.
JRE : JRE stands for Java Runtime Environment, its provides an
environment to execute the Java program. It internally contains JVM which is
responsible to execute a Java program.
JVM : JVM stands for Java Virtual Machine, it is the software in the form of
interpreter written in C programming language though which we can execute
our java program.
2. What are the features of Java?
Object oriented
Platform independent
Portable
Compiled and Interpreted
Robust
Distribution
Performance
Multithreaded
Dynamic
3. Discuss about various datatype available in Java.
Ans : Data types specify the different sizes and values that can be stored
in the variable.
Primary/Primitive Datatype :
Numeric :
A. Integric :
I. Byte (1byte)
II. Short (2 bytes)
III. Integer (4 bytes)
IV. Long (8 bytes)
B. Decimal :
I. Float (4 bytes)
II. Double (8 bytes)
Non-Numeric :
I. Char (2 bytes)
II. Boolean (1 bit)
User Define/Non-primitive Datatype :
I. Class
II. Interface
III. Arrays
IV. String
4. Explain various of operators are available In Java.
Ans : Operators is a symbol that is used to perform operations according
to the user requirement through the values and variables.
I) Arithmetic Operators (+, -,*,/,%) : These operators are used to
perform basic mathematical operation.
II) Relational Operators (<,>,<=,>=,==,!=) : These operators
compare two Operands and return a boolean value.
III) Logical Operators (&&,||,!) : These operators are used to
combine or modify boolean expression.
IV) Assignment Operators : These operators are used to assign the
right hand operand's value to the right hand operand.
a) Simple Assignment ( = )
b) Compound Assignment ( +=, -=, *=, /=)
V) Bitwise Operators : These operator perform operation on the
individual bits of integer operands. They work on byte, sort, integer,
long and character data type.
VI) Increment and Decrement Operators :
a) Post increment & Pre increment (I++, ++I)
b) Post Decrement & pre Decrement (I--, --I)
VII) Ternary Operators/Conditional operators : ( ? : )
5. What is the conditional operator? Give an example.
Ans : Conditional operator is also known as ternary operator because it is
work on three operands, the conditional operator behaves likes an if-else
statement.
Syntax :- Condition? if true(expression 1) : if false(expression 2) ;
Example : Find the maximum number among two numbers.
Public class Conditional_Operators{
Public static void main(String[] args){
Int a=10,b=20,max;
Max=(a>b)?a: b;
[Link](“max is : “ + max);
}
}
6. Define array with syntax? Explain one-dimensional array and
multidimensional array in Java.
Ans :
7. Explain about string class and string method in Java.
And :
8. Explain about basic concepts of OOPS? Write the application of
OOPS.
Ans :
9. What is classes can be defined in Java?
Ans :
10. Explain how to create objects and accessing class members
with example.
Ans :
11. Explain about constructors with example.
Ans :
12. What is inheritance?
Ans :
13. What are the different forms of inheritance supported by Java?
Ans :
14. What is interface?
Ans :
15. Explain about abstract classes and method with example.
Ans :
16. Explain about different types of package?
Ans :
17. What is an exception?
18. what is an error? Explain about different types of errors?
19. Explain about exceptional handling mechanism?
20. Explain about file class and method with example ?
21. What is a thread?
22. In how many ways can a thread be created in Java? Explain and
give an example?
23. Write about thread priorities with example?
24. Describe the complete life cycle of thread?
25. What is an applet?
26. Explain the lifecycle of applet with neat diagram?
27. Write about JDBC?
28. Explain working with my SQL database?
29. Write the database programming using JDBC? Write various
stages in a database program?