JAVA MCQs with answers Page - 5

Dear candidates you will find MCQ questions of JAVA here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question

Y

Yogesh • 7.43K Points
Tutor III

Q. What are the components of a marker interface?

  • (A) Fields, no methods
  • (B) No fields, No methods
  • (C) No fields, only methods
  • (D) Fields and methods

Y

Yogesh • 7.43K Points
Tutor III

Q. Which of the following is not a directive in JSP?

  • (A) taglib directive
  • (B) page directive
  • (C) command directive
  • (D) include directive

Y

Yogesh • 7.43K Points
Tutor III

Q. Java code is embedded under which tag in JSP?

  • (A) Expression
  • (B) Declaration
  • (C) Scriptlet
  • (D) Comment

Y

Yogesh • 7.43K Points
Tutor III

Q. Can and <%–comment–%> be used alternatively in JSP?

  • (A) False
  • (B) True
  • (C) ---
  • (D) ---

Y

Yogesh • 7.43K Points
Tutor III

Q. What temporarily redirects response to the browser?

  • (A) response.setRedirect(URL)
  • (B) <%@directive%>
  • (C) response.sendRedirect(URL)
  • (D) None of these

Y

Yogesh • 7.43K Points
Tutor III

Q. Which object stores references to the request and response objects?

  • (A) sessionAttribute
  • (B) HttpSession
  • (C) pageContext
  • (D) sessionContext

Y

Yogesh • 7.43K Points
Tutor III

Q. “out” is implicit object of which class?

  • (A) javax.servlet.jsp.JspWriter
  • (B) javax.servlet.jsp.SessionPrinter
  • (C) javax.servlet.jsp.SessionWriter
  • (D) javax.servlet.jsp.PrintWriter

M

Manisha Agrawal • 9.34K Points
Tutor III

Q. Consider the following code snippet.
The code is equivalent to which code?

Code:
for(var n in m)
   console.log(m[n]);
  • (A) for (var i = 1;i < a.length;i++) console.log(a[i]);
  • (B) for (var i = 0;i < a.length;i++) console.log(a[i]);
  • (C) for (int i = 0;i < a.length;i++) console.log(a[i]);
  • (D) for (var i = 0;i <= a.length;i++) console.log(a[i]);

R

Ram Sharma • 193.86K Points
Coach

Q. Who is considered as the creator of JAVA ?

  • (A) Dennis Richie
  • (B) Ken Thompson
  • (C) James Gosling
  • (D) Bjarne Stroupstrup

R

Ram Sharma • 193.86K Points
Coach

Q. Which of the following statements about the Java language is true?

  • (A) Java supports only Procedural Oriented Programming approach
  • (B) Both Procedural and Object Oriented Programming are supported in Java
  • (C) Java supports only Object Oriented Programming approach
  • (D) None of the Above

Loding content...

Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.

Image

Login

Forgot username? click here

Forgot password? Click here

Don't have account? Register here.