0% found this document useful (0 votes)
7 views

Computer Mcq- Class9

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computer Mcq- Class9

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Computer Applications

MCQ- Revision
SET 5
1) In object oriented programming, the stress is given on:
a) procedure
b) methods
c) class
d) data ✓
2) Which of the following principle does not allow to access directly from outside the class
premises?
a) data hiding
b) encapsulation
c) abstraction
d) all of the above ✓
3) The process of combining data and functions that enables them to be together as a
single entity is
a) inheritance
b) encapsulation ✓
c) classification
d) attributes
4) The process by which a class acquires the properties from another class is called:
a) polymorphism
b) inheritance ✓
c) abstraction
d) object
5) In procedural programming, the stress is laid on:
a) class
b) function ✓
c) data
d) object
6) Which of the following is a blue print that creates objects of similar types?
a) abstraction
b) encapsulation
c) class ✓
d) function
7) Which of the following is not an object oriented programming language?
a) C++
b) Simula
c) BASIC ✓
d) Java
8) The process of restricting the free flow of data from the outside world is known as:
a) Encapsulation ✓
b) inheritance
c) function
d) class
9) Which of the following is true for Polymorphism?
a) Uses same function for different operations ✓
b) Uses same operation for different functions
c) It is not a principle of OOP
d) It uses reusability feature.
10) In procedure oriented programming, the stress is given on:
a) Data
b) Function ✓
c) Object
d) Class
11) Which of the following keywords is used to create an instance of a class?
a) new ✓
b) public
c) class
d) main
12) The ............... is called an instance of a class.
a) attribute
b) object ✓
c) state
d) features
13) The objects we see around us are called as:
a) Real world object ✓
b) Virtual object
c) Imaginary object
d) None of the above
14) Which of the following makes a function non-returnable?
a) public
b) static
c) void ✓
d) main
15) How many bytes a char data type occupies in the memory?
a) 2 ✓
b) 8
c) 4
d) 16
16) Which of the following is a non-primitive data type?
a) int
b) double
c) char
d) String ✓
17) Which of the following is non-numeric data type?
a) boolean ✓
b) int
c) float
d) double
18) Which of the following ASCII code range is applicable for lowercase letters?
a) 65 - 90
b) 90 - 115
c) 97 – 122 ✓
d) 95 - 110
19) What is not an escape sequence?
a) \t
b) \\
c) \n
d) || ✓
20) Which of the following is the correct precedence of logical operators?
a) !, &&, || ✓
b) &&, !, ||
c) ||, !, &&
d) &&, ||, !
21) Choose the odd one out from the following:
a) >
b) ==
c) && ✓
d) <
22) Given: String st = (a>= 90)? "Excellent": "Best"; Predict the output, when a = 90.
a) Best
b) Excellent: Best
c) Best: Excellent
d) Excellent ✓
23) Choose the odd one out from the following:
a) Unary operator
b) Binary operator
c) Ternary operator
d) Bitwise operator ✓
24) Given: x += x++ + ++x + --x; Find the value, when x=5.
a) 23 ✓
b) 21
c) 22
d) 24
25) A Java program developed and executed by the users without using web browser is
known as:
a) Application ✓
b) applet
c) object
d) none
26) Who developed Java?
a) James Gosling ✓
b) Robert James
c) Bjarne Stroustrup
d) Sundar Pichai
27) Java Virtual Machine (JVM) is an:
a) Interpreter ✓
b) compiler
c) machine code
d) byte code
28) Java is a case sensitive language. Which is the most appropriate statement with
respect to this context?
a) Upper and lower case letters are distinguished. ✓
b) Upper and lower case letters are ignored.
c) Only lower case letters are distinguished.
d) Lower case letters are ignored.
29) Which of the following package is needed to find the square root of a number?
a) java.text
b) java.math
c) java.lang ✓
d) Math.sqrt
30) Which of the following is not a Java reserved word?
a) private
b) public
c) break
d) total ✓
31) if(a<b)
c=a;
else
c=b;
It can be written as:
a) c= (b<a)?a:b;
b) c= (a!=b)?a:b;
c) c= (a<b)?b:a;
d) c= (a<b)?a:b; ✓
32) If(a<b && a<c)
a) a is the greatest number
b) a is the smallest number ✓
c) b is the greatest number
d) none
33) Which of the following features is not the principle of OOP?
a) Encapsulation
b) Transparency ✓
c) Inheritance
d) Polymorphism
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 behaviour are grouped together into
a/an ...........
a) Interface
b) Instance
c) Alias
d) Class ✓
36) ........... is the technique of binding both data and methods together to keep them
safe from unauthorised access and misuse.
a) Abstraction
b) Inheritance
c) Encapsulation ✓
d) Polymorphism
37) ........... refers to the act of representing essential features without including the
background details.
a) Abstraction ✓
b) Inheritance
c) Encapsulation
d) Polymorphism
38) Proceure Oriented Programming mainly uses ...........
a) Top-down approach ✓
b) Top-down and bottom-up approach
c) Bottom-up approach
d) None of these
39) ........... is the feature using which one class acquires the properties of another class.
a) Abstraction
b) Inheritance ✓
c) Encapsulation
d) Polymorphism
40) An object has ...........
a) Attributes
b) State
c) Behaviour
d) All of these ✓
41) A class is ...........
a) An object factory
b) A blueprint to create objects
c) A specification for objects
d) All of these ✓
42) ........... represents an entity in the real-world with its identity and behaviour.
a) A class
b) An object ✓
c) A procedure
d) A method
43) ........... is a template to create similar objects that share common characteristics and
behaviour.
a) A method
b) A procedure
c) An attribute
d) A class ✓
44) The values of an object's ........... represent the state of the object.
a) methods
b) procedures
c) attributes ✓
d) classes
45) What is the full form of JVM?
a) Java Visual Monitor
b) Java Video Monitor
c) Java Virtual Monitor
d) Java Virtual Machine ✓
46) The full form of JRE is ...........
a) Java Runtime Editor
b) Java Runtime Environment ✓
c) Java Runtime Expression
d) Java Runtime Enabler
47) Java uses ........... for execution.
a) compilation and interpretation ✓
b) interpretation only
c) compilation only
d) None of these
48) A program that translates code written in a high-level language into machine code is
called ...........
a) Assembler
b) Linker
c) Compiler ✓
d) None of these
49) A program that translates an assembly language program into machine code is called
...........
a) Assembler ✓
b) Linker
c) Compiler
d) None of these
50) Feature(s) of Java include ...........
a) robust
b) object oriented
c) secure
d) All of these ✓
51) Java can be used to write ...........
a) stand-alone applications only
b) both stand-alone and internet applications ✓
c) internet applications only
d) None of these
52) The smallest individual component in a program is called ...........
a) Token ✓
b) Identifier
c) Keyword
d) Method
53) Which of the following is not a token?
a) Keyword
b) Identifier
c) Operator
d) Procedure ✓
54) Which of the following is a keyword?
a) character
b) break ✓
c) object
d) attribute
55) Which of the following is not a legal identifier?
a) _room
b) $PayAmount
c) 20ab20 ✓
d) nullValue
56) Which of the following is not a character literal?
a) '\n'
b) "n" ✓
c) 'n'
d) All of these
57) Which of the following punctuator is the statement terminator in Java?
a) ; ✓
b) .
c) ,
d) All of these
58) Which of the following is not a primitive data type in Java?
a) boolean
b) short
c) float
d) class ✓
59) Single line comments can be added using ...........
a) // ✓
b) /* */
c) \
d) Both A and B
60) Which of the following changes a variable declaration into a constant?
a) const
b) constant
c) static
d) final ✓
61) If a = 8 and b = 4, the value of a %= b is ...........
a) 2
b) 0 ✓
c) 4
d) 8
62) An operator taking only single operand for its operation is called ...........
a) A unary operator ✓
b) A binary operator
c) A ternary operator
d) None of these
63) Which one of the following is not a binary operator?
a) AND
b) %
c) ==
d) ! ✓
64) Which one of the following is not a valid operator in Java?
a) <=
b) !== ✓
c) !=
d) ==
65) The statement i = i + 1 is equivalent to ...........
a) i++
b) i += 1
c) ++i
d) All of these ✓
66) For x = 5, the statement sum = ++x + 8 evaluates to ...........
a) sum = 12
b) sum = 13
c) sum = 14 ✓
d) sum = 15
67) Assuming x = 1 with the following code snippet:
int y = --x;
Which one of the following is true?
a) x=1, y=1
b) x=0, y=0 ✓
c) x=1, y=0
d) x=0, y=1
68) The statement (1>0) && (1<0) evaluates to ...........
a) 0
b) 1
c) false ✓
d) true
69) The statement (1>0) || (1<0) evaluates to ...........
a) 0
b) 1
c) false
d) true ✓
70) The statement (1==1)? 1: 0 evaluates to ...........
a) 0
b) 1 ✓
c) false
d) true
71) The expression 17 % 4 gives the output ...........
a) 4
b) 3
c) 2
d) 1 ✓
72) Consider the following code snippet:
float x = 8.25F;int y;
y = (int) x; What are the values of x and y?
a) x= 8.25, y = 8 ✓
b) x = 8.0, y = 8.0
c) x = 8, y = 8.25
d) x = 8, y = 8
73) The expression 13 / 3 gives the output ...........
a) 4 ✓
b) 3
c) 0
d) 1
74) The statement System.out.println("six " + 3 + 3); gives the output ...........
a) six 33 ✓
b) six 6
c) 33 six
d) 6 six
75) The expression 4 + 8 % 2 gives the output ...........
a) 6
b) 8
c) 4 ✓
d) None of these
76) Implicit type conversion is also known as ...........
a) Automatic type conversion
b) Type promotion
c) coercion
d) All of these ✓
77) Which operator cannot be used with if-else statement?
a) <=
b) ||
c) &&
d) ? : ✓
78) What will be the output of the following code?
int size = 2;
if (size < 0)
System.out.println("Small");
else if (size == 0)
System.out.println("Medium");
else
System.out.printIn("Large");
a) Small
b) Large ✓
c) Medium
d) Runtime error
79) What will be the output of the following code?
int fruit = 3;
switch (fruit + 1)
{
case 1:
System.out.println("Banana");
break ;
case 2:
System.out.println("Apple");
break ;
case 3:
System.out.println("Orange");
break ;
default :
System.out.println("Fruitless");
}
a) Orange
b) Banana
c) Apple
d) Fruitless ✓
80) Predict the output of the following code snippet:
int a = 1;
int b = 2;
if (a == b)
System.out.println ("Both values are equal");
else
System.out.println ("Values are not equal");
a) Both values are equal
b) Incorrect use of the == operator
c) Values are not equal ✓
d) No output
81) Consider the following code snippet:
if ( c > d)
x = c;
else
x = d;
Choose the correct option if the code mentioned above is rewritten using the ternary
operator:
a) x = (c >d) ? c : d; ✓
b) x = (c >d) ? d : c;
c) x = (c >d) ? c : c;
d) x = (c >d) ? d : d;
82) if ((a > b) && (a > c)), then which of the following statements is true?
a) a is the largest number. ✓
b) b is the largest number.
c) c is the largest number.
d) b is the smallest number.
83) Consider the following code snippet:
int val = 2;
switch (val)
{
case 1: System.out.println("Case 1");
break;
case 2: System.out.println("Case 2");
break;
default: System.out.println("No match found");
break;
}
Which of the following statements is correct?
a) case 1 will be executed.
b) case 2 will be executed. ✓
c) default will be executed.
d) both case 1 and 2 will be executed.
84) A sequence of statements enclosed between a pair of curly brackets is called
a) a compound statement ✓
b) an empty statement
c) a null statement
d) a void statement
85) Which clause is optional in the switch statement?
a) default ✓
b) case
c) switch
d) None of these
86) Which of the following statements involves a fall-through?
a) if-else
b) for loop
c) if-else-if ladder
d) switch ✓
87) Which of the following causes a fall-through in the switch statement?
a) the omission of fall
b) the omission of continue
c) the omission of break ✓
d) the omission of loop
88) Which of the following is mandatory in the switch statement?
a) break
b) continue
c) case ✓
d) default
89) Which of the following statement is a valid combination?
a) if inside switch ✓
b) switch inside if ✓
c) else inside switch
d) default inside if

You might also like