Important Java questions and programs for ICSE class 9th and 10th board exams

Helpful for ICSE IX X Standard students in Java BlueJ programming online tutorial and programs :: 
Click here to contact
ICSE Java Tutorial exclusively designed for ICSE students of class 9th and 10th grade to learn Java programming language in BlueJ environment. This tutorial will help students in java programming with important questions,programs,notes,tips and tricks.All types of programming problems include topics like variables,datatypes,operands and operators, commission, decision structure , looping,arrays,strings,library functions etc.. are covered in the in terms of sample questions and important question and answers for ICSE X standard board examinations as well as act as strong foundation for IX standard ICSE students.
Important questions of ICSE class 10th board exam Section-A
Question::
a) What is Inheritance ? [2]
Ans. Inheritance is the process by which one class extends another class to inherit the variables and functions and add any additional variables and methods.
b) Name the operators listed below [2]
i) < ii) ++ iii) && iv) ?:
Ans. i) Less than comparison operator
ii) Increment operator
iii) And logical operator
iv) Ternary operator
c) State the number of bytes occupied by char and int data types.[2]
Ans. char occupies two bytes and int occupied 4 bytes.
d) Write one difference between / and % operator. [2]
Ans. / is division operator while % is modulus operator which gives the remainder on dividing two numbers.
Question::
a) Name of the following: [2]
i) A keyword used to call a package in the program.
ii) Any one reference data types.
Ans. i) import
ii) String
b) What are the two ways of invoking functions? [2]
Ans. Call by value and call by reference
c) State the data type and value of res after the following is executed : [2]
1 char ch = 't';
2 res = Character.toUpperCase(ch);
Ans.Data type of res is char and value is T
d) Give the output of the following program segment and also mention the number of times the loop is executed: [2]
int a,b;
for(a=6,b=4;a<=24;a=a+6)
{
if(a%b==0)
break;
}
System.out.println(a);
Ans.
Loop initialization: a = 6, b = 4
First iteration:
Condition check: a <= 24 --- 6 <= 24 ---- true
Loop is executed for the first time
Loop execution: a % b = 6 % 4 = 2 != 0 Hence, break is not executed
Loop increment operator: a = 1 + 6 --- a = 6 + 6 = 12
Second iteration:
Condition check: a <= 24 --- 12 <= 24 ---- true
Loop is executed for the second time
Loop execution: a % b = 12 % 4 = 0 = 0 Hence, break is executed
System.out.println(a); --- 12
Output is 12 and loop is executed two times
Question::
a) Write a Java expression for the following : [2]
ax5 + bx3 + c
Ans. a * Math.pow(x, 5) + b * Math.pow(x, 3) + c
b) Why is an object called an instance of a class? [2]
Ans. An object is called an instance of a class as every object created from a class gets its own instances of the variables defined in the class.Multiple objects can be created from the same class.
d) Convert following do-while loop into for loop. [2]
int i=1;
int d=5;
do{
d=d*2
System.out.println(d);
i++;
}while(i<=5);
Ans.
for(int i=5, d=5; i<=5; i++) {
d = d * 2;
System.out.println(d);
}
c) Differentiate between constructor and function. [2]
Ans. The constructor of a class is invoked automatically during object creation while a function is invoked manually after object creation.
A constructor is invoked only once while a function can be invoked multiple times.
A constructor has the same name as the class in which it is defined while a function can have any name.
g) What are the values stored in variables r1 and r2: [2]
i) double r1 = Math.abs(Math.min(-2.83,-5.83));
ii) double r2 = Math.sqrt(Math.floor(16.3));
Ans. i) double r1 = Math.abs(Math.min(-2.83,-5.83));
= Math.abs(-5.83)
= 5.83
ii) double r2 = Math.sqrt(Math.floor(16.3));
= Math.sqrt(16)
= 4.0
Click here for Booking Demo Class