Programming - First Step towards Java Programming
You Are Here :: Home > JAVA > First Step towards Java Programming - General Questions
19. |
what happens if string args[ ] is not written in main()?
|
A. |
only code will compile |
B.
|
JVM cannot run the code |
C.
|
code will compile but JVM cannot tun the code
|
D.
|
JVM run the code
|
|
Answer: Option C
Explanation:
If string args[ ] is not written in main() code will compile but JVM cannot run the method. |
|
20. |
______________ method belongs to Print Stream Class.
|
A. |
final |
B.
|
static |
C.
|
nonstatic
|
D.
|
print()
|
|
Answer: Option D
Explanation:
print() belongs to Print Stream Object. |
|
21. |
__________________ gives the print Stream Class Object.
|
A. |
co.in |
B.
|
system.in |
C.
|
system.out
|
D.
|
out.println
|
|
Answer: Option C
Explanation:
system.out gives the Print Stream Object. |
|
22. |
Is println() and print() methods both are same or not>
|
A. |
Yes |
B.
|
No |
C.
|
Cant say
|
D.
|
none
|
|
Answer: Option B
Explanation:
print() displays the result and then retain the cursor in the same line.
Println() displays the result and then throws the cursor to the next line. |
|
23. |
\n refers ________________________________
|
A. |
next line |
B.
|
back space |
C.
|
enter key
|
D.
|
form feed
|
|
Answer: Option A
Explanation:
|
24. |
\t refers ___________________________
|
A. |
next line |
B.
|
back space |
C.
|
enter key
|
D.
|
horizontal tab space
|
|
Answer: Option D
Explanation:
\t refers horizontal tab space. |
|
« prev
next »