Q.1 What do people use Java? What are the main advantages of using java?
Java is a popular programming language to develop all android and web applications as well as commercial applications. The main advantage of using Java is that its robustness and fully object-oriented.
Q.2 Give salient features of the java language?
Java language gives a lot of feature to the Java users. Java provides two type of translators together, first is Compiler and second is interpreter. Instead of this, Java provides cross platform feature to execute the program on any operating system such as (Windows, Linux, Mac) etc.
Q.3 What do you understand by:
- Inheritance -: It means to use the method and properties of the parent class.
- Polymorphism -: Poly means many and morphism means forms. we can define the method that is single but its many forms.
- Variable -: It means – we can change the value or can be possible to vary the value during the execution of a Java Program.
- While loop -: It is a type of loop that can iterate one or more instructions.
Q.4 What does class statement signify in a java Program?
Class statement is necessary for all java programs, if we are not defining a Class in java program, we can not run that Java program. we defines a class statement like as-
Class Class_Name { // Instructions }
Q.5 What does the main statement signify in java?
the main statement is also necessary as a class for all java programs because each and every program is started from the main() method. we can define the main() method as follow –
public static void main(String pro[]) { //instructions }
Q.6 What do brackets and semi-colon represent in Java?
Brackets and semi-colon both are special type symbols that represent the method are defined and enclosed with open and close brackets, a semicolon represents the instruction is ended.
Q.7 What are increment and decrement Operators?
Increment operators operate on one operand. This operator increases the value of the integer operand by the addition of one(1) in that operand.
Decrement operators operate on one operand. This operator decreases the value of the integer operand by the subtraction of one(1) in that operand.
Q.8 What do you understand by the Ternary operator?
Ternary operator operate on three operands. This operator gives the conditional result and checks if the condition is true, so first statement is running otherwise second will running.
Example -: <condition> ? (first-statement) : (second statement)
Q.9 What are logical operators?
logical operators are those operators that is used to check the condition of variable or constant.
Q.10 How would you save, compile and run a Java Program?
There are several steps to reach the goal. we will see step by step procedure to save, compile and run a Java program.
First create file -:
firstprogram.java
Open the file and write the java program.
Class FirstProgram { public static void main(String args[]) { System.out.println("Hello!!! Dear Students"); } }
After creating a program, press the combination key ctrl + s to save your java file.
After the saving file, we must to do compile a program.
javac filename
After compiling the java file, we can run a java program.
type -: java FirstProgram