• 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...
  • Which is a valid PostConstruct method in a message-driven bean class?
    Which is a valid PostConstruct method in a message-driven bean class? a. @PostConstruct a. public boolean init() { return true; } b. ...
  • Which is NOT a scope of implicit objects of JSP file?
    Which is NOT a scope of implicit objects of JSP file? a. application b. page c. request d. session e. response Answer: E
  • 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. ...
  • Identify the correct element is required for a valid tag in web.xml (Choose one)
    Identify the correct element is required for a valid <taglib> tag in web.xml (Choose one)  a. <uri> b. <tag-uri> c...
  • If the increment operator is __________ to a variable, first the variable is incremented by 1, then its new value is used in the expression.
    If the increment operator is __________ to a variable, first the variable is incremented by 1, then its new value is used in the expression....
  • A bean present in the page and identified as 'mybean' has a property named 'name'. Which of the following is a correct way to print the value of this property?
    A bean present in the page and identified as 'mybean' has a property named 'name'. Which of the following is a correct way...
  • In a(n) __________ relationship, an object of a subclass can also be treated as an object of its superclass.
    In a(n) __________ relationship, an object of a subclass can also be treated as an object of its superclass. Answer: Is-a
  • 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 ...
  • 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; %...

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