Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

2.

Which type of casting shown by the following example


long y =15 , int x ; x = (int) y;

Explicit Type Casting


Implicit Type Casting
automatic type casting
none
3.An object is created using -
new
this
return
none
4.Updating values of variables during execution of the program is-
initialization
dynamic initialization
declaration
instantiation
5.What is the result of 111 % 13 = _________
3
5
7
9
6.A java program developed and executed by the users by using web browser is known
as ___________

application
none
applets
objects
7.The smallest unit in a java program is known as.
Identifier
Token
Separators
JVM
8.Choose the odd one out:-
{}
>
;
,
9.Which of the following are valid comments?
(i) /* comment */
(ii) /* comment
(iii) // comment
(iv) */ comment */

(i) & (iii)


(i) & (ii)
All
None
10.The continue statement transfers the control out of the loop body and thus stops
the loop iteration.

true
false
11._________________is the name given to a variable, function or a class
literal
identifier
separator
Operator
12.A program in java is executed usually with _________________________.
branching control construct
sequential control construct
serial control construct
iterative control construct
13.double discount=bill>10000?(bill*10.0/100):(bill*50.0/100.0); when bill=9000
900.0
4500.0
400.0
compiling error
14.switch(x)
{case 'a':System.out.println("Discipline");
case 'b':System.out.println("Dedication");break;
case 'c':System.out.println("commitment");
default:System.out.println("Success");} when x='A'
Displine
Dedication
Success
commitment
15.if(c>d)
x=c;
else
x=d;
rewrite in ternary
(1 Point)
x=(c>d)?d:d;
x=(c>d)?c:c;
x=(c>d)?d:c;
x=(c>d)?c:d;

You might also like