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
Which of the following is an invalid variable name in Java?
A. $char
B. 1mynumber
C. caseof
D. _int
Consider the following piece of code:
float lu luckyNumber = 1.25;
System.out.println ( "The value of luckyNumber: " + luckyNumber );
What is the result?
A. The value of lucky number::
B. The value of lucky number: 1.25
C. The code would not compile
D. The code will compile but will give a runtime error.
Look this code:
1. class CodeWalkOne {
2. public static void main(String [] args) {
3. int [] counts = {1,2,3,4,5};
4. counts[1] = (counts[2] == 2) ? counts[3] : 99;
5. System.out.println(counts[1]);
6. }
7. }
A. Compilation fails on line 4.
B. 3
C. 4
D. 99
Consider the following code fragment:
1. public class Question{
2. public static void main(String[] args) {
3. byte x = 21;
4. byte y = 13;
5. int z = x^y;
6. System.out.println(z);
8. }
What is the result of this code fragment?
A. 24
B. 29
C. 21
D. A compiler error occurs at line 5.
Which of the following expressions is legal?
A. int x=9;
B. int y=!x;
C. double z=9.00>>2;
D. int i=^7;
Which of the following statements would not produce the compile error?
A. char my_char='c';
B. char your_char='int';
C. char what='hello';
D. char what_char="L";
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