Class 10th Ch.1 Part v(a) Introduction to Java
Class 10th Ch.1 Part v(a) Introduction to Java
Q.6 What is meant by a package? Name any two Java applications programming interface
packages.
Ans: Packages contains logically related classes together. Each Package define a number of
classes which can be used in the program by importing a single package.
Two Java Applications Programming interface packages are:
i. Java.io
ii. Java.util
d.JVM is an / a ……………………… .
i. Interpreter ii. Compiler
iii. Intermediate code iv. High level Language
EXERSISE
Q.1 Multiple choice question
1.
Source Program Compiler Object Program
From the above illustration , which of the following roles best describe for a compiler in Java
programming?
a. Language Changer b. Language Modifier
c.Language Transformer d. Language Translator
2. A java program developed and executed by the user without using web browser is known as:
a. Application b. Applet c. Object d. none of these
5. Java is a case sensitive language . Which is the most appropriate statement with the respect
to this content?
Ans: a. Uppercase and Lowercase letters are distinguished
6. Which of the following packages is needed to find the square root of a number?
Ans: b. java.math
10. Read the following text and choose the correct answer:
BlueJ version is a menu driven approach for the java programming. It allows the user to carry out
different tasks by clicking the options available on the menu bar.
Ans: a. It is a Window based platform.
8. Write down the syntax of output statement in Java programming with an example
Answer
We commonly use two output statements in Java. There syntax are:
1. System.out.println(<output value>); — This statement prints data on the console. The
data to be printed is passed to the println method as a String. After printing the string, it
places the cursor at the start of the next line. So the next printing happens at the start of
the next line.
2. System.out.print(<output value>); — This statement also prints data on the console. The
data to be printed is passed to the print method as a String. After printing the string, the
cursor remains on the same line at the end of the printed string. So the next printing
starts in the same line just after the end of the previous printed string.
As an example, the below statements will generate the following output:
System.out.println("JVM stands for");
System.out.print("Java ");
System.out.print("Virtual ");
System.out.print("Machine");
Output
JVM stands for
Java Virtual Machine
9. What do you meant by Java reserved words? Name at least five Java reserved words
which are commonly used in Java programming.
Answer
In Java, a reserved word is a word that has a predefined meaning in the language. Due to this,
reserved words can’t be used as names for variables, methods, classes or any other identifier.
Reserved words are also known as keywords. Five commonly used Java reserved words are:
1. public
2. class
3. int
4. double
5. char
System.out.println() System.out.print()
It prints data to the console and places It prints data to the console but the cursor
the cursor in the next line. remains at the end of the data in the same line.