Java Theory Questions
Java Theory Questions
Java Theory Questions
What is Java?
Java is a high level programming language
It is Two step compilation process
It is platform independent
It supports Object Oriented Programming
It is case sensitive
Features if Java:
Simple
Object Oriented
Robust
Portable
High performance
Structure of Java:
class className
{
public static void main(String[] args)
{
--
}
}
What is JVM?
JVM stands for Java Virtual Machine
It is platform dependent
It is a translator used to convert Byte code into machine understandable format
What is JDK?
JDK stands for Java Development Kit
It is used to compile and run the java program
What is JIT?
JIT stands for Just InTime Compiler
It is used to increase the performance during conversion of byte code into binaries.
Write the command for compile and run java program in command
prompt?
Compile : javac classname.java
Run : java classname
What is Keyword?
Keywords are the reserved words in java
Each keyword has its own meaning
These are pre-defined words
It should be in lower case
In java there are 49+ keywords
Example: class , static, if, for
What is Literals?
Literals are just an information or value
There are five types of literals. They are Integer literals, Float literals, Character
literals, String literals, Boolean literals.
What is variables?
Variables are the named memory block which is used to store the data.
Example: int a=10;
What is Datatypes?
Datatype is used to specify what kind of data that is stored inside memory
There are two types. They are
Primitive Datatypes
Non-Primitive Datatypes
What is Operators?
Operators are pre-defined symbols which is used to perform some tasks.
It is used to perform an operation.
In java based on number of operands , we can classify into three types:
➔ Unary operator
➔ Binary operator
➔ Ternary operator
What is Expression?
The combination of operators along with operands is called as an expression
What is Break?
It is control transfer statement.
It is used in switch or loop .
It is used to take the control from switch or loop.