ICSE X/ Sample Test,Sample questions

Question:
 An operator 1s a symbol to process the data
 

1.char

2.int

3.char and int both

Posted Date:-2022-01-19 03:15:37


Question:
 int i-6
int d-6
do
d-d*2
System.out.println (d),
How many times the loop is executed and what is the output?

1.Loop is not executed any time and the output is 6.

2.Loop is executed once and the output is 12.

3.Loop is executed 2 times and the output is 24.

Posted Date:-2022-01-19 02:10:05


Question:
 The number of bytes occupied by char data type is __________ byte/s

1.4

2.8

3.2

4.None of these

Posted Date:-2022-01-18 23:23:19


Question:
 Which one of the following is not an operator?

1.new

2.calloc

3.malloc

Posted Date:-2022-01-19 03:17:35


Question:
!(2>3&&40>6)

1.True

2.False

Posted Date:-2022-01-19 01:25:28


Question:
(c)_______________:

1.k<=n

2.k<=4;4

3.k+n

Posted Date:-2022-01-19 02:19:39


Question:
(d)____________________)
{ 
System.Out.PrintIn.(k)
}

1.k+=2

2.k+=5

3.k++

Posted Date:-2022-01-19 02:22:30


Question:
{ d=n%10; s=(C) __________________.
n=n/10;

1.s+d*d

2.s*d+d

3.s*s+d

Posted Date:-2022-01-19 03:10:46


Question:
A function calling itself

1.Calling function

2.Recurring function

3.Recursive function

Posted Date:-2022-01-19 01:15:19


Question:
A parent class of a class

1.sub class

2.super class

3.parent

Posted Date:-2022-01-19 01:18:45


Question:
All the functions of a package can be imported by using the __________
character with import statement.

1..

2.*

3./

4.@

Posted Date:-2022-01-18 23:33:11


Question:
Among the following, which method does not have a body.

1.A class

2.An interface

3.An abstract method

4.None of the above

Posted Date:-2022-01-18 23:16:11


Question:
Byte code is generated by

1.Javac

2.DVV

3.JVM

Posted Date:-2022-01-19 01:17:33


Question:
Choose the odd one

1.>

2.! =

3.%

4.<

Posted Date:-2022-01-19 01:50:29


Question:
Choose the odd one

1.return

2.break

3.continue

4.System.exit(0)

Posted Date:-2022-01-19 01:54:17


Question:
Choose the odd one

1.CLR

2.JVM

3.JDK

4.AWT

Posted Date:-2022-01-19 01:56:08


Question:
Choose the odd one

1.++

2.%

3.--

4.! =

Posted Date:-2022-01-19 01:56:53


Question:
Choose the odd one

1.Int

2.Char

3.New

4.Double

Posted Date:-2022-01-19 01:48:59


Question:
class (a) ______________
{
int noc; double bill :

1.Power

2.Class

3.Object

Posted Date:-2022-01-19 02:38:11


Question:
class (a)______________

1.Number

2.Character

3.class

Posted Date:-2022-01-19 02:14:23


Question:
double is a non- primitive data type:

1.True

2.False

Posted Date:-2022-01-19 01:23:48


Question:
else bill = (e)______________
void print()
System.out.println("Name = "+n);
System.out.println("Amount to be paid-"+bill);

1.bill=(n-100)*2.50

2.bill=(n-100)*3.50

3.bill=n*2.50

Posted Date:-2022-01-19 02:57:48


Question:
if (()
System.out.print In("Number is even");
else
System.out.print In("Number is odd");
}
}

1.if(n%2 == 0)

2.if(n%n == 0)

3.if(n/2 == 0)

Posted Date:-2022-01-19 02:26:30


Question:
if (a!=b)
System.out.println(a*b);
else
System.out.printin (a-b);
when a = 6 and b = 5

1.11, 30

2. 30

3. 30, 11

Posted Date:-2022-01-19 02:05:13


Question:
Multiple branches is used by ___________statement.

1.Break

2.Switch

3.Continue

4.Loop

Posted Date:-2022-01-18 23:21:09


Question:
n-n/10;
}
System.out.println("Norm = " + (d)___________);
}

1.Maths.sqrt(s)

2.Maths.SQRT(s)

3.Math.sqrt(n)

Posted Date:-2022-01-19 03:13:02


Question:
Name of = operator is

1.Relational

2.Assignment

3.Bitwise

Posted Date:-2022-01-19 03:16:44


Question:
Name the type of error in the statement given below
int t-0;
int r-100/t

1.Syntax

2.Runtime

3.Logical

4.Warning

Posted Date:-2022-01-18 23:18:23


Question:
Operators with higher precedence are evaluated before operators with relatively lower precedence.
Arrange the operators given below in order of higher precedence to lower precedence.

(i) -  (ii)  %   (iii)  *   (iv)  +

1.(iv),(i),(iii),(ii)

2.(iv),(i),(ii),(iii)

3.(ii),(iii),(iv),(i)

4.(i)(ii)(iii)(iv)

Posted Date:-2022-01-18 23:13:00


Question:
print( (e) _____________)

1.Int n

2.Double n

3.Char n

Posted Date:-2022-01-19 02:23:35


Question:
S

1.True

2.False

Posted Date:-2022-01-19 01:27:27


Question:
String n;
Scanner ob = (b) ___________________Scanner(System.in);
void input()

1.old

2.new

3.void

Posted Date:-2022-01-19 02:40:09


Question:
switch ( x )
case 'a System.out.printin("Honest")
case 'bSystem.out.printin ("Punctual")
break;
case 'c':System.out.println("Committed")
default System.out.println("Average");
when x=A

1.Average

2.Punctual

3.Committed

4.Honest

Posted Date:-2022-01-19 02:08:45


Question:
System.out.printin("Enter name ");
n-ob.next():
void calculate)
bill -0;
if ( (d)________________bill =0;
 

1.noc<=100

2.noc = 0

3.noc >100

Posted Date:-2022-01-19 02:47:01


Question:
System.out.printin("Enter Number of calls"
noc (c)______________.

1.ob.nextDouble()

2.ob.nextLine()

3.ob.nextInt()

Posted Date:-2022-01-19 02:43:27


Question:
The ________________ is called the basic blue print of the object

1.Class

2.Attributes

3.State

4.None of these

Posted Date:-2022-01-18 23:28:21


Question:
The Comparisonoperator(==) is left associative.

1.True

2.False

Posted Date:-2022-01-19 01:28:57


Question:
The function call in which the data in actual parameters get changed is called

1. Call by value

2.Formal call

3.Call by reference

Posted Date:-2022-01-19 01:21:34


Question:
The mandatory statement to each block of the switch loop is

1.System.exit(0)

2.break

3.default

Posted Date:-2022-01-19 01:20:21


Question:
the___________are those pre-defined words in Java which meaning is already declared by Javac.

1.Keywords

2.Identifier

3.Methods

4.Package

Posted Date:-2022-01-18 23:30:30


Question:
void norm (i
Void norm ( int n)
{ int d, s =(a)___________.

1.0

2.0.0

3.1

Posted Date:-2022-01-19 03:06:01


Question:
void print (int n)
int k;
( (b) ___________;

1.k = 1

2.k = n

3.k = 0

Posted Date:-2022-01-19 02:16:15


Question:
What are the bitwise operators?

1.+,-,++,--

2.==,<=,!=

3.<<,>>

Posted Date:-2022-01-19 03:14:37


Question:
What is the final value stored in variable x ?
double a =- 2.25;
double x = Math.sqrt (Math.abs(a));

1.1.5

2.2.5

3.6.25

4.0.25

Posted Date:-2022-01-18 23:17:19


Question:
Which of the following is invalid access modifier ?
(i) class  (ii)  public  (iii)  private   (iv)  protected

1.(i)

2.(ii)

3.(iii)

4.(iv)

Posted Date:-2022-01-18 23:03:06


Question:
While ( (b)____________)

1.n>0

2.n=0

Posted Date:-2022-01-19 03:08:07


Question:
While loop executes at least once.

1.True

2.False

Posted Date:-2022-01-19 01:28:09


Question:
x+ x+ ++x+ -x+ X; [x= 1]

1.9

2.8

3.6

4.5

Posted Date:-2022-01-19 02:00:21


More MCQS

  1. help4info.com
  2. help4info.com
  3. help4info.com
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!