AmbitionBox
Discover Best Places to work in India
Discover best places to work
Compare & find best workplace
Bring your workplace to life
Highlight your company's perks
Read reviews for 6L+ companies
Rate your former or current company
Discover salaries for 8L+ companies
Calculate your take home salary
Check your market value
Help other jobseekers
Read interviews for 90K+ companies
Interviews questions for 1K+ colleges
Contribute your interview questions
Java Programming
The signed right shift operator in Java is --. Select the one correct answer.
<<
>>>
>>
None of these
intx = 0, y = 0 , z = 0 ; x = (++x + y-- ) * z++;
What will be the value of "x" after execution ?
-2
-1
0
1
C is the correct answer.
int ++a = 100 ; System.out.println( ++a ) ;
What will be the output of the above fraction of code ?
100
Displays error as ++a is not enclosed in double quotes in println statement
Compiler displays error as ++a is not a valid identifier
class Numbers{public static void main(String args[]){inta=20, b=10; if((a < b) && (b++ < 25)){ System.out.println("This is any language logic"); } System.out.println(b); } }
12
11
10
Select from among the following character escape code which is not available in Java.
\t
\r
\a
What will be the output?
if(1 + 1 + 1 + 1 + 1 == 5){ System.out.print("TRUE"); }else{ System.out.print("FLASE"); }
True
False
Compiler Error
A is the correct answer.
Consider the following code fragment:
int x;
int a = 5;
int b= 8;
x = ++a + b++;
After the execution of this code fragment, what is the value of x?
A. 13
B. 14
C. 15
D. Compilation fails
1. public class Unary{
2. public static void main(String[] args) {
3. byte x = 7;
4. byte y = 6*x++;
5. byte z = x*y;
6. System.out.println ("z: " + z);
7. }
What is the output of this code fragment?
A. z:42
B. z:48
C. The code will not compile due to line 4.
D. The code will compile but will generate a run time error.
public class Unary
{
public static void main(String[] args)
int x = 7;
int y = 6*x++;
System.out.println (" y= " + y);
int a = 7;
int b = 6*++a;
System.out.println (" b= " + b);
}
A. y=42
b=48
B. y=48
C. y=48
b=42
D. y=42
int x = 9;
int y = -2;
System.out.println("output: " + x%y);
A. -1
B. 1
C. 4.5
D. 4
Join India’s largest community to research company culture
Are you a student or working professional?
Student/Never worked
I am a student/I have never worked
Working Professional
I am working/I have worked before
What are your preferred job locations?
Popular Cities
Other Cities
Follow your preferred designations/job profiles
Suggestions based on your job profile
vs
Similar Companies