12th Computer Application MCQS with Answers Available Here.
You can read and practice, 12th Computer Application MCQS with Answers on a lot of Topics:
1) What
will be printed as the output of the following program?
public class
testincr
{
public static void main(String args[])
{
int i = 0;
i = i++ + i;
System.out.println(“I = ” +i);
}
}
a. I = 0
b. I = 1
c. I
= 2
d. I = 3
e. Compile-time Error.
2) What
is the output of the following program:
public class
testmeth
{
static int i = 1;
public static void main(String args[])
{
System.out.println(i+” , “);
m(i);
System.out.println(i);
}
public void m(int i)
{
i += 2;
}
}
a. 1 , 3
b. 3 , 1
c. 1 , 1
d. 1 , 0
e. none of the above.
3) What is the type and value of the following expression?
(Notice the integer division)
-4 + 1/2 + 2*-3
+ 5.0
a. int -5
b. double -4.5
c. int -4
d. double -5.0
e. None of the above
4) What
is printed by the following statement?
System.out.print(“Hello,\nworld!”);
a. Hello, \nworld!
b. Hello, world!
c. Hello,
world!
d. “Hello, \nworld!”
e. None of the above.c
5)
Which of the following variable declaration would NOT compile in a java
program?
(a) int var;
(b) int VAR;
(c) int var1;
(d) int var_1;
(e) int 1_var;.
6)
You read the following statement in a Java program that compiles and executes.
submarine.dive(depth);
What
can you say for sure?
(a)
depth must be an int
(b) dive must be a method.
(c) dive must be the name of an instance field.
(d) submarine must be the name of a class
(e) submarine must be a method.
7)
What is the output of the following code:
class
eq
{
public static void main(String args[])
{
String s1 = “Hello”;
String s2 = new String(s1);
System.out.println(s1==s2);
}
}
(a) true
(b) false
(c) 0
(d) 1
(e) Hello.
8)
Identify, from among the following, the incorrect variable name(s).
(a) _theButton
(b) $reallyBigNumber
(c) 2ndName
(d) CurrentWeatherStateofplanet
(e) my2ndFont.
9)
Use the following declaration and initialization to evaluate the Java
expressions
int
a = 2, b = 3, c = 4, d = 5;
float k = 4.3f;
System.out.println(
– -b * a + c *d – -);
(a) 21
(b) 24
(c) 28
(d) 26
(e) 22.
10)
Consider the following Java program :
class
IfStatement{
public static void main(String args[])
{
int a=2, b=3;
if (a==3)
if (b==3)
System.out.println(“===============”);
else
System.out.println(“#################”);
System.out.println(“&&&&&&&&&&&”);
}
}
Which
of the following will the output be?
(a)
===============
(b) #################
&&&&&&&&&
(c) &&&&&&&&&&&
(d) ===============
#################
&&&&&&&&&&
(e) ################.
11) Java compiler javac translates Java
source code into ………………………
(a) Assembler language
(b) Byte code
(c) Bit code
(d) Machine code
(e) Platform dependent code.
12) ……………….. are used to document a
program and improve its readability.
(a) System cells
(b) Keywords
(c) Comments
(d) Control structures
(e) Blocks.
13) Identify, from among the following,
the incorrect descriptions related to Java :
(a)
Java Virtual Machine translates byte code into its own system’s machine
language and runs the resulting machine code
(b) The arithmetic operations *, /, %, + and – have the same level of
precedence
(c) Comments do not cause any action to be performed during the program
execution
(d) All variables must be given a type when they are declared
(e) Java variable names are case-sensitive.
14) Consider the following statement(s)
about Java:
I.
All white-space characters (blanks) are ignored by the compiler.
II. Java keywords can be used as variable names.
III. An identifier does not begin with a digit and does not contain any spaces.
IV. The execution of Java applications begins at method main.
Which
of them is correct?
(a) Both (I) and (III) above
(b) Both (II) and (IV) above
(c) Both (I) and (II) above
(d) (III) and (IV) above
(e) All (I), (II), (III) and (IV) above.
15) For what values respectively of the
variables gender and age would the Java expression gender == 1 && age
>= 65 become true?
(a) gender = 1, age = 60
(b) gender = 1, age = 50
(c) gender = 1, age = 65
(d) gender = 0, age = 70
(e) gender = 0, age = 55.
16) Consider the following Java program
:
public class
Compute {
public static
void main (string args [ ])
{
int result, x ;
x = 1 ;
result = 0;
while (x < = 10) {
if (x%2 == 0) result + = x ;
+ + x ;
}
System.out.println(result) ;
}
}
Which
of the following will be the output of the above program?
(a) 55
(b) 30
(c) 25
(d) 35
(e) 45.
17)(A.B)’=A’+B’ Is a …………………..
a. Demorgon’s Law.
b. Distributive law
c. Involution law
d. Adsorption law
18)If
the final result of the Truth Table of a proposition come all 1’s then it is
termed as……………
a. Tautology
b. Contingency
c. Contradiction
d. Invaild
19)if((a!=b)&&(a == c)) then which of the following
statement is true:
- b is the
smallest number
- b is the
greatest number
- a is the
smallest number
- none
20)A Java program
executes but does not give the desired output. It is due to the
- logical
error in the program
- syntax error in the program
- grammatical error
- none
21)State the final value of q at the end of the following
program segment after execution. Show the dry run.
for(m=2;m<=3;++m)
{
for(n=1;n<=m;++n)
{
p=m+n-1;
if(p%3 == 0)
q += p;
else
q += p+4;
}
}
a.
27
b.
25
c.
29
d.
30
e.
28
Answers:
1)
b2) c
3) d
4) c
5) e
6) b
7) b
8) c
9) b
10) c
11) b
12) c
13) b
14) III and IV(d)
15) C
16) B
17) A
18) A
19) 4
20) 1
21) C
3 Comments
Can you make more of these?
ReplyDeletereally helpful !
ReplyDeleteHello!
ReplyDeleteI'm a specialist in web development.
web development is an especially well known calling nowadays. web development is a specific limit. districts make our online business astoundingly clear. with a Site, you can sell or buy your things in exceptionally fundamental ways and with basically no issue. with this limit, you can accomplish your own work as a prepared proficient.
I have made a Site shakeelmumtaz.com, where you can find concerning web development.