0% found this document useful (0 votes)
1K views14 pages

Question Bank For CBT (Class Ix Icse) 2020

The document contains a question bank for an online computer science exam. It includes 40 multiple choice questions related to Java programming concepts like data types, operators, loops, classes, objects, inheritance, encapsulation, polymorphism and more. The questions are meant to test a student's understanding of basic Java concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views14 pages

Question Bank For CBT (Class Ix Icse) 2020

The document contains a question bank for an online computer science exam. It includes 40 multiple choice questions related to Java programming concepts like data types, operators, loops, classes, objects, inheritance, encapsulation, polymorphism and more. The questions are meant to test a student's understanding of basic Java concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

PANIHATI, SODEPUR

KOLKATA-700114

QUESTION BANK FOR ONLINE CBT

SNMS SPECIAL
SUBJECT : COMPUTER SCIENCE
CLASS : IX
1. What is the range of short data type in Java?

©SUBHANKAR BANERJEE
a) -128 to 127
b) -32768 to 32767
c) -2147483648 to 2147483647
d) None of these
2. Fill in the blank so that the following program prints twice of 5.
class twice
{
public static void main()
{
int a, th;
a=5;
tw= ;
System.out.print(tw);
}
}
a.a*a
b.2*a
c.5*5
d.5+5
3. Fill in the blank to print the age of a person after 10 years
whose present age is 15 years.
class age
{
public static void main()
{
int a,b; a=15;
b= ;
System.out.println(b);
}
}
a.a+10
b.a-10
c.b-10

©SUBHANKAR BANERJEE
d. None of the above
4. Choose the correct option to fill in the blank to print the
perimeter of a square whose side is 18 cm.
class area
{
public static void main()
{
int s,a; s=18;
a= ;
System.out.println(a);
}
}
a.s*s*s
b.4*s
c.s*s
d.None of the above
5. Find the error in the following JAVA statement if any:
public static void main
a.p is to be written in capital letter
b.”;” missing after main function
c. “()” missing after main function
d.No error
6. What will be the output of the following program
class print_month
{
public static void main()
{
String n2=“11”;
String n1=“MONTH”;
System.out.println(n1+” “+n2);
}
}
a. MONTH 11

©SUBHANKAR BANERJEE
b. “MONTH 11”
c.11 MONTH
d. “11 MONTH”
7. Choose which of the following is a correct option for the
following program code:
class print
{
public static void main()
{
System.out.print(“Online”+” “);

System.out.println(“Learning”);
}
}
a.Online Learning
b.Learning Online
c.OnlineLearning
d.”Online Learning”
8. Choose the correct option to fill in the blank to find the profit of a
seller it the cost price is 100 rupees and the selling price is 185 rs
class pro
{
public static void main()
{
int s,c,p;
c=100;
s=185;
p= ;
System.out.println(p);
}
}
a.c+s
b.c-s

©SUBHANKAR BANERJEE
c.s-c
d.s+c
9. Find the correct output of the following program to print the
perimeter of a rectangle whose length is 24m and breadth is 12m.
class area
{
public static void main()
{
int l,b,p;
l=24;
b=12;
p=2*(l+b);
System.out.println(p);
}
}
a.72
b.68
c.52
d.44
10. Find the statement which is not correct in the following
program to print the sum of 7 and 8
class sum_error
{
public static void main()
{
int a,b,c;
a=7;
b=8;
c=a+b;
System.out.println(b);
}
}
a.int a,b,c;

©SUBHANKAR BANERJEE
b.System.out.println(b);
c.a=7;
d.none of the above
11. Find the correct output of the following program to print:
class calc
{
public static void main()
{
int a,b,c,d;
a=10;
b=5;
c=4;
d=a+b-c;
System.out.println(d);
}
}
a.10
b.13
c.12
d.11
12. Find the statement which is not correct in the following
program to print the cube of 8
class cube
{
public static void main()
{
int P=8;
int c;
c=P*PXP;
System.out.println(c);
}
}
a.class cube

©SUBHANKAR BANERJEE
b.int P=4;
c.c=P*PXP;
d.all of the above
13. Find the correct output of the following program to print the
remainder of 14 and 5
class output
{
public static void main()
{
double a,b,c;
a=14;
b=5;
c=a%b;
System.out.println(c);
}
}
a. 4.0
b.0
c.5.0
d.None of the above
14. Fill in the blank so that the following program prints cube of
15
class cube
{
public static void main()
{
int a, cb; a=15;
cb= ;
System.out.print(cb);
}
}
a.a*a*a
b.a*3

©SUBHANKAR BANERJEE
c.15*15
d. a*a
15. Fill in the blank to print the age of a person before 4 years
whose present age is 15 years.
class age
{
public static void main()
{
int a,b; a=15;
b= ;
System.out.println(b);
}
}
a.a+4
b.a-4
c.b-4
d.None of the above
16. Choose the correct option to fill in the blank to print the area
of a square whose side is 10 cm
class area
{
public static void main()
{
int s,a;
s=10;
a= ?;
System.out.println(a);
}
}
a.s*s*s
b.4*s
c.s*s
d.None of the above

©SUBHANKAR BANERJEE
17. Find the error in the following JAVA statement if any:
public static void main
a. p is to be written in capital letter
b. () missing after main
c. Semicolon missing after main
d. No error
18. Choose which of the following is a correct option for the
following program code:
class print
{
public static void main()
{
System.out.print(“GO”+” “);

System.out.println(“CORONA”);
}
}
a.GO CORONA
b.CORONAGO
c.GOCORONA
d.None of the above
19. Find the statement which is not correct in the following
program to print the addition of 15 and 10
class add_Error
{
public static void main()
{
int a,b,c;
a=15;
b=10;
c=a+b;
System.out.println(b);
}
}

©SUBHANKAR BANERJEE
a.int a,b,c;
b.a=15;
c.System.out.println(b);
d.None
20. What will be the output of the following program
class yr
{
public static void main()
{
String n2="2020”;
String n1=" HAPPY NEW YEAR";
System.out.println(n1+" "+n2);
}
}
a. HAPPY NEW YEAR 2020
b. "HAPPY NEW YEAR 2020"
c.2020 HAPPY NEW YEAR
d. "2020 HAPPY NEW YEAR"
21. Choose the correct option to fill in the blank to find the loss
of a seller it the cost price is 1000 rupees and the selling price is
800 rs
class loss
{
public static void main()
{
int s,c,l;
c=1000;
s=800;
l=? ;
System.out.println(l);
}
}

©SUBHANKAR BANERJEE
a.c+s
b.c-s
c.s-c
d.s+c
22. Find the correct output of the following program to print the
area of a rectangle whose length is 10m and breadth is 6m.
class area
{
public static void main()
{
int l,b,a; l=10; b=6;
a=l*b;
System.out.println(a);
}
}
a.60 b.18 c.32 d.24
23. Find the correct output of the following program to print:
class simp_output
{
public static void main()
{
int a,b,c,d;
a=10;
b=6;
c=8;
d=a-c+b;
System.out.println(d);
}
}
a.8 b.6 c.10 d.12
24. Find the statement which is not correct in the following
program to print the twice of 8
class twice_error

©SUBHANKAR BANERJEE
{
public static void main()
{
int a=8;
int t;
t=2xa;
System.out.println(t);
}
}
a. class twice_err
b. int a=4;
c. t=2xa;
d. all of the above
25. Find the correct output of the following program to print the
quotient of 32 and 6
class output
{
public static void main()
{
double a,b,c; a=32;
b=6;
c=a/b;
System.out.println(c);
}
}
a. 4.2 b.6 c.5.3 d.None of the above
26. Which of the following is a valid declaration of a char?
A. char ch = '\utea';
B. char ca = 'tea';
C. char cr = \u0223;
D. char cc = '\itea';
27. Evaluate the following Java expression, if x=3, y=5, and
z=10:
++z + y - y + z + x++
A.24
B.23
C.20
D.25
28. Which of the following for loop declaration is not valid?
A.for ( int i = 99; i >= 0; i / 9 )
B.for ( int i = 7; i <= 77; i += 7 )
C.for ( int i = 20; i >= 2; - -i )
D.for ( int i = 2; i <= 20; i = 2* i )
29. In java, jar stands for .
A. Java Archive Runner
B. Java Application Resource
C. Java Application Runner
D. None of the above
30. The Size of int Data type is
A.16 bit
B.32 bit
C.64 bit
D.Depends on execution environment
31. Procedure Oriented Programming gives importance to-
A. Instructions only C. Data only
B. Instructions and data D. None of the above
32. Procedure Oriented Programming mainly uses
A. Top-down approach C. Bottom-up approach
B. Top-down and bottom-up approach D. None of the above
33. Object Oriented Programming mainly uses
A. Top-down approach C. Bottom-up approach
B. Top-down and bottom-up approach D. None of the above
34. An object belonging to a particular class is known as a/an
. Of that class.
A. Interface B. Instance C. Alias D. Member
35. Objects that share the same attributes and behavior are
grouped together into a/an .
A. Interface B. Instance C. Alias D. Class
36. is the technique of binding both data and functions
together to keep them safe from unauthorized access and misuse.
A. Abstraction C. Encapsulation
B. Inheritance D. Polymorphism
37. refers to the act of representing essential features
without including the background details.
A. Abstraction C. Encapsulation
B. Inheritance D. Polymorphism
38. is the feature by means of which one class acquires
the properties of another class.
A. Abstraction C. Encapsulation
B. Inheritance D. Polymorphism
39. The ability of a function or object to take on multiple forms
is called
A. Abstraction C. Encapsulation
B. Inheritance D. Polymorphism
40. The term OOP stands for
A. Object Oriented Procedure C.Object Oriented Programming
B. Object Oriented Packet D. Object Orientation Procedure
**SOLUTIONS WILL BE UPLOADED ON GOOGLE CLASSROOM**
©SUBHANKAR BANERJEE
CONTACT : ©7003520912 /7278457824

You might also like