01. Java Source Code is compiled into ______________.
- Source Code
- Obj
- Exe
- Bytecode
Correct Answer: Bytecode
02. Which class provides stream to read binary data such as image etc. from the request object?
- ServltInputStream
- ServletOutputStream
- Both A & B
- None of the above
Correct Answer: ServletInputStream
03. Which of the following is used to interpret and execute Java Applet Classes hosted by HTML.
- appletshow
- appletviewer
- appletwatcher
- appletscreen
Correct Answer: appletviewer
04. Java servlets are an efficient and powerful solution for creating ………….. for the web.
- Dynamic content
- Static content
- Hardware
- Both a and b
Correct Answer: Dynamic content
05. Which is used for reading streams of raw bytes such as image data and for reading streams of characters, consider using FileReader?
- FileInputStream
- FileOutputStream
- Both A & B
- None of the above
Correct Answer: FileInputStream
06. The command javac is used to
- debug a java program
- compile a java program
- interpret a java program
- execute a java program
Correct Answer: compile a java program
07. Which method is used to change the name of a thread?
- public String getName()
- public void setName(String name)
- public void getName()
- public String setName(String name)
Correct Answer: public void setName(String name)
08. What will be the output of the program?
class PassA{public static void main(String [] args){PassA p = new PassA();p.start();}void start(){long [] a1 = {3,4,5};long [] a2 = fix(a1);System.out.print(a1[0] + a1[1] + a1[2] + " ");System.out.println(a2[0] + a2[1] + a2[2]);}long [] fix(long [] a3){a3[1] = 7;return a3;}}{codeBox}
- 12 15
- 15 15
- 3 4 5 3 7 5
- 3 7 5 3 7 5
Correct Answer: 15 15
09. Java programs are
- Faster than others
- Platform independent
- Not reusable
- Not scalable
Correct Answer: Platform independent
10. What of the following is the default value of a local variable?
- null
- 0
- Depends upon the type of variable
- Not assigned
Correct Answer: Not assigned