• Home
  • Ask a Question
  • About
  • Contact
  • Advertise
  • Sitemap
MENU

Ad Java MCQ

Java | Advance Java | Multiple Choice | Questions and Answers | Test Bank

  • Home
  • Translate

True or false? An object of a class that implements an interface may be thought of as an object of that interface type.

Add Comment

True or false? An object of a class that implements an interface may be thought of as an object of that interface type.



Answer: True

True or false? If a superclass declares an abstract method, a subclass must implement that method.

Add Comment

True or false? If a superclass declares an abstract method, a subclass must implement that method.



Answer: False

True or false? Invoking a subclass-only method through a subclass variable is not allowed.

Add Comment

True or false? Invoking a subclass-only method through a subclass variable is not allowed.



Answer: False

True or false? All methods in an abstract class must be declared as abstract methods.

Add Comment

True or false? All methods in an abstract class must be declared as abstract methods.



Answer: False

Casting a reference stored in a superclass variable to a subclass type is called __________.

Add Comment

Casting a reference stored in a superclass variable to a subclass type is called __________.



Answer: Downcasting

Methods that are not interface methods and that do not provide implementations must be declared using keyword __________.

Add Comment

Methods that are not interface methods and that do not provide implementations must be declared using keyword __________.



Answer: Abstract

_________ involves using a superclass variable to invoke methods on superclass and subclass objects, enabling you to "program in the general."

Add Comment

_________ involves using a superclass variable to invoke methods on superclass and subclass objects, enabling you to "program in the general."



Answer: Polymorphism

Subscribe to: Comments (Atom)

Search your questions here...

Trending Questions

  • A JSP page called test.jsp is passed a parameter name in the URL using http://localhost/Final/test.jsp?name=John. The test.jsp contains the following code.
    A JSP page called test.jsp is passed a parameter name in the URL using http://localhost/Final/test.jsp?name=John. The test.jsp contains th...
  • _____ methods allow the programmer to obtain the value of an object's instance variables.
    _____ methods allow the programmer to obtain the value of an object's instance variables. Answer: Accessor
  • To send binary output in a response, the following method of HttpServletResponse may be used to get the appropriate Writer/Stream object.
    To send binary output in a response, the following method of HttpServletResponse may be used to get the appropriate Writer/Stream object. ...
  • Which statement is correct about the Java Persistence API support for the SQL queries?
    Which statement is correct about the Java Persistence API support for the SQL queries? a. SQL queries are NOT allowed to use parameter...
  • If a class declares constructors, the compiler will not create a(n) __________.
    If a class declares constructors, the compiler will not create a(n) __________. Answer: Default constructor
  • The Java Persistent API defines the Query interface. Which statement is true about the Query.executeUpdate method ?
    The Java Persistent API defines the Query interface. Which statement is true about the Query.executeUpdate method ? a. It must always b...
  • When an object of a subclass is instantiated, a superclass __________ is called implicitly or explicitly.
    When an object of a subclass is instantiated, a superclass __________ is called implicitly or explicitly. Answer: Constructor
  • True or false? A has-a relationship is implemented via inheritance.
    True or false? A has-a relationship is implemented via inheritance. Answer: False
  • What gets printed when the following code snippet is compiled? Select the one correct answer. <% int y = 0; %> <% int z = 0; %>
    What gets printed when the following code snippet is compiled? Select the one correct answer. <% int y = 0; %> <% int z = 0; %...
  • A JSP page needs to generate an XML file. Which attribute of page directive may be used to specify that the JSP page is generating an XML file?
    A JSP page needs to generate an XML file. Which attribute of page directive may be used to specify that the JSP page is generating an XML ...

Blog Archive

  • March (110)
  • June (46)
  • February (54)
  • September (68)
  • July (47)
  • February (147)

Label

Absolute Java Chapter 4 Advanced Java JAVA Java Chapter 4
Powered by Blogger.
Copyright © 2015 Ad Java MCQ | Term Of Service | Disclaimer | Privacy Policy | DMCA