0% found this document useful (0 votes)
164 views7 pages

Question On Computer

The document contains 20 multiple choice questions related to Java programming concepts. The questions cover topics like data types, operators, errors, constants, ASCII values, comments, output of code snippets, and more. The last 9 questions ask about object oriented programming concepts like principles, inheritance, abstraction, primitive vs non-primitive types, and casting.

Uploaded by

Alpana Shekhar
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)
164 views7 pages

Question On Computer

The document contains 20 multiple choice questions related to Java programming concepts. The questions cover topics like data types, operators, errors, constants, ASCII values, comments, output of code snippets, and more. The last 9 questions ask about object oriented programming concepts like principles, inheritance, abstraction, primitive vs non-primitive types, and casting.

Uploaded by

Alpana Shekhar
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/ 7

1.

A data type which contains integer as well as fractional


part and occupies 32 bits space is
(a) float (b) char
(c) double (d) byte (ICSE 2022)
2. What is the final value stored in variable x?
doublex = Maths.ceil (Math.abs(-7.3);

(a) 7.0 (b) 8.0


(c) 6.0 (d) 9.0 (ICSE 2022)
3. Which of the following keyword is used to create symbolic
constants in Java?
(a) final (b) Final
(c) constant (d) const (ICSE 2022)
4. Name the type of error
double x; y; Z;
(a) logical error (b) syntax error
(c) runtime error (d) No error (ICSE 2022)
5. The ASCII code of 'B' is
(a) 67 (b) 66
(c) 98 (d) 99 (ICSE 2022)
6. The program code written in any high-level language to
solve a problem is
(a) object code (b) source code
(c) machine code (d) byte code (ICSE 2022)
7. State whether the statement is true or false:(ICSE2022)
(i) Class is a non-primitive data type.
(a) True (b) False
(ii) Multi line comments in Java start with /* and end
with */
(a) True (b) False
(ii) = is an assignment operator.

(a) True (b) False


(iv) Java compiler automatically creates a default
constructor in case no constructor is present in the
Java clasSs.
(a) True (b) False
20
(ICSE 2022)
8. Choose the odd one
(b) %
i) (a) > =

*
(c)/ (d)
(ii) (a) double (b) int

(c) char (d) string


(ii) (a) if else (b) if
(c) switch case (d)while()
(6) nextDouble( )
Civ) (a) nextint()
(d) next ( )
(c) nextstring ()
(b) Platform independent
(v) (a) Robust
(c) Inheritance (d) Multi threading
(ICSE 2022)
9. Give the output
i) int x = 2, y = 4, z = l;

int result =
(++ z) + y + (++ x) + (z ++)
(a) 11 (b) 12
(c) 10 (d) 9
(ii) int f = 10, m = 9;

String e =
(m% f = =9)?"YES": "NO;"

System.out.print(e);
(a) YES (b) NO
(c) YESN0 (d NOYES

10. The process of binding the data and function together as


one unit is called
(a) Encapsulation (b) Inheritance
(c) Polymorphism (b) Dynamic binding
(ICSE 2022)
11. Evaluate the value of the expression when,
X = 2, y = 3 and z = 1

V = X + -- z + y++ + y
(ICSE 2019)
12. What is the value of y after evaluating the expression?
y+++y +y+--Y; when inty =8 (ICSE 2018)
13. What is the value of xl if x = 5?
xl = ++X - X + + - - X
(ICSE 2017)
14. Give the output
a+ a+++++a + --a +a--; when a = 7
(ICSE 2016)
15. If int y =10, then find
*
int (++y (y++ + 5);
z=
(ICSE 2015)
16. Give the output
public static void main ()
{int a = 5;
a t+;

System.out.printin (a);
a-=(a--(--a);
System.out.println (a); (ICSE 2014)
17.What will be the result stored in x?
intx = 4; x+ = (X++) +(++X) + X; (ICSE 2012)
18. What will be the output of the following?
int k = 5; j = 9;

k+=k++-++)+k;
System.out.println ("k=" + k);
System.out.printin ("j = " + j);

(ICSE 2011)
19. What is the result stored in x?
int x = 5; X = X++ * 2 + 3 * - - X;
(ICSE 2010)
20. If the value of basic = 1500, what will be the value of
tax after the following statement is executed?
tax basic >1200? 200: 100; (ICSE 2019)
21.Convert the following into ternary operator:
if(bill> 10000)
discount = bill*10.0/100.0;

else
discount = bill* 5.0/100.0; (ICSE 2018)
22. Rewrite the following using ternary operator:
if (x% 2 == 0)

System.out.print ("EVEN");
else
System.out.print ("ODD"); (ICSE 2016)
23. Evaluate the value of a. If value of p = 5, q = 19
int a = (q - p) > (p - q)? (q - p) : (p- q);

(ICSE 2015)
24. Rewrite thefollowing ternary into if-else:
String grade = (marks >= 90)? "A" : (marks>=80)?
"B": "C"; (ICSE 2014)
25.Rewrite thefollowing into if-else:
comm = (sale> 15000)?sale * 5.0/100.0 0;

(ICSE 2013)
26. What are the values of x and y?
inta 63, b = 36;
boolean x = (a > b)? true : false;
int y = (a < b)? a : b;
(ICSE 2012)
27. Rewrite using ternary operator
if (income <=10000)
tax = 0;
else
tax = 12;
(ICSE 2007)
28.If a = 5, b 9;
Calculate the value of a + =(a ++) - (++b) + a;
(ICSE 2008)
Oriented

29. Name the two basic principles of Object


(ICSE 2019)

Programming.
and binary operator.
30. Write a difference between unary (ICSE 2019)

data in
short and float type
31. Write the memory capacity of (ICSE 2019)

bytes.
32. Identify and name the token:
(iv) {} (ICSE 2019)
) public (ii) 'a (ii)==
in Java?
33. What are the various types of errors
(ICSE 2019)

34. int res = 'A;


(ICSE 2018)
What is the value of res?

35. System.out.print ("BEST");


System.out.println ("OF LUCK");
Choose the correct option;
(i) BEST OF LUCK
(i) BEST
(ICSE 2018)
OF LUCK
36. Write the output of the following:
System.out.println ("Incredible" + "n"+ "world");
(ICSE 2018)
37. Write the output:
char ch='f';
int m=ch;
m=m+5;
System.out.println (m+" "+ch); (ICSE 2017)
38. Define abstraction. (ICSE 2018)
39. Classify as primitive and non-primitive data types:
(i) char (ii) arrays
(ii) int (iv) classes (ICSE 2018)
40. What is inheritance? (ICSE 2017)
41. Name the operators listed below
(i) (ii) ++
(ii) && (iv)? (ICSE 2017)
42. Write one difference between/and % operator
(ICSE 2017)
43. Name the type of error
(i) Math.sqrt (36 45)
(i) int a; b; C; (ICSE 2016)
Revision of Class IX Syllabus

44. What are the types of casting shown?


() char c =(char) 120;
(ii) int x = 't'; (ICSE 2016)
45. Give one difference between primitive data types and
composite data types? (ICSE 2016)
46. What are the default values of the primitive data type int
and float? (ICSE 2015)
47. Name two 0OP's principle. (ICSE 2015)
48. Identify the literals follows:
(i) O.5 (i)) 'A
(ii) false (iv) "a" (ICSE 2015)
49. Arrange the following primitive data types in ascending
order of their sizes :

(i) char (ii) byte


(iil) double (iv) int (ICSE 2015)
50. State the package that contains the class
(i) BufferedReader

i) Scanner (ICSE 2015)


51. Which of the following are valid comments?
(i)/* comment */ ii) * comment
(ii) // comment (iv) */comment / (ICSE 2014)
52. What are the types of casting shown below?
(i) double x =15.2;
int y = (int) x;
(ii) int x = 12;

longy= X; (ICSE 2013)


53. Write a Java statement to create an object mp4 of class
digital? (ICSE 2013)
54. Name the type of error
(i) Division by a variable that contains a value of zero.
(i) Multiplication operator used when the operation
should be division.
(ii) Missing semicolon. (ICSE 2012)
55. What is the difference between an object and a class ?
(ICSE 201 1)
56. (i)Why is an object called an instance of a class?
(ii) What is the use of the keyword import?
(ICSE 2010)
57. State the difference between a boolean literal and
character literal. (ICSE 2009)
58. What is the use and syntax of a ternary operator?
(ICSE 2009)
24

59. What does the following


mean (ICSE 2008)
Employee staff = new Employee ( );
(ICSE 2007)
60. Name the two types of Java Programs.
61. Name the following
) A package that is invoked by default.
in package.
(11) A Keyword, to use the classes defined
(ICSE 2007)
the
values of
O4. Evaluate the following expressions, the
variables a = 2, b = 3 and c = 9.
(i) a - (b++) * ( - - c)

(ii) a * (++b)% c
(ICSE 2006)

O3. What is the purpose of the new operator? (ICSE 2005)

segment; when :
64. Find the output of the following program
(i) val = 550;
int val, sum, x = 550;

sum x +val> 1750? 400 200;


system.out.printin (sum);
Gi) val = 1600;

int val, sum, n = 550;


Sum n + val > 1750? 400: 200;
system.out.println (sum); (ICSE 2005)

65. What will be output for the following segment?


int a 0, b = 30, c = 40;
a = (--b) + (C++) + b;
system.out.printin ("a ="+a); (ICSE 2005)
66. Define Java byte code. (ICSE 2020)
67. Name the following: (ICSE 2020)
(i) The keyword which converts variable into constant.
(ii) The method which terminates the entire program
from any stage.
68. Which of the following are primitive data types?
(i) double (ii) String (ii) char (iv) Integer
(ICSE 2020)
69.What is an operator? Name any two types of operators
used in Java. (ICSE 2020)
70. Rewrite the following program segment
using logical
operators
if(x> 5)
if(x> y)
system.out.println (x + y); (ICSE 2020)
KevisiOn O l l d s s lA OylladD

71. Convert the following if else if construct into switch case:


if (ch == 'c' || ch == 'C')
System.out.print ("cOMPUTER");
else if (ch == 'h' || ch = = 'H')
System.out.print ("HINDI");
else
System.out.print ("PHYSICAL EDUCATION");
(ICSE 2020)
72. Rewrite the following using ternary operator
if(n1> n2)
r true;
else
r = false; (ICSE 2020)
73. Evaluate the following if the value of x = 7, y = 5
X+= X++ +X + t+y (ICSE 2020)
74. Write the output of the following statement
System.out.println ("A picture is worth It'A thousand
words./"); (ICSE 2020)
75. What is the use of import statement in Java?
(ICSE 2020)
76. Read the following case study and answer the questions
given below by choosing the correct option
(ICSE 2022)
Java compilation is different from the compilation of
other high-level languages. Other high-level languages
use interpreter or compiler but in Java, the source code
is first compiled to produce an intermediate code called
the byte code, this byte code is platform independent
and is a highly optimized set of instructions designed to
be executed by Java in the run time system called JVM
(Java Virtual Machine), JVM is a Java interpreter loaded
in the computer memory as soon as Java is loaded. JVM
is different for different plattorms.
i)Full form of JVM is
(a) Java Visual Machine
(b) Joint Vision Mechanism
(c) Java Virtual machine
(d) Java Virtual Mechanism
(ii) JAVA code is
(a) Compiled and interpreted
(b) Only compiled
(c) Only interpreted
(d) Translated
(ii) JAVA source code is complied to produce
(a) Object code (b) Byte code
(c) Final code (d) Machine code
(iv) JAVA is an/a:
(a) Interpreter (b) Compiler
(c) Intermediate code (d) High-level language

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy