Quiz 4 Practice Quiz

True or False: Java does not support multiple inheritances with classes.
True
False
To use an interface in Java, use the keyword ______.
extends
public
implements
static
Inheritance upcasting is a(n) _____.
A. reference variable of a superclass type that points to an object of its subclass.
B. expression like: int c = (int)2.718281D;
C. class that inherits from the class Object.
D. synonym of multilevel inheritance
True or False - Hierarchical Inheritance is one the three forms you can use in Java without the assistance of interfaces.
True
False
True or False - If a class implements an interface and does not provide method bodies for all functions specified in the interface, then the class must be declared abstract.
True
False
Which of these are file types in java?
A. Text Files
B. Binary Files
C. Both A and B
D. None of the above
An interface is similar to an abstract class, because it has no fields and all abstract _________.
Methods
Classes
Constructors
Fields
Java's predefined exceptions are divided into two categories: _______ exceptions and ________ exceptions
A: Regular / Irregular
B: Simple / Complex
C: Try / Catch
D: Checked / Unchecked
What is the syntax of abstract class in java?
A. abstract A{}
B. abstract class A
C. abstract class A{}
D. abstract class A[]
In Java a throwable class is?
A. A disposable class
B. Not heirarchical
C. Parent class of Exceptions and Errors
D. Child class of Exceptions
True or False - A reference to an interface CANNOT point to any class that implements that interface.
True
False
True or False - Interfaces help to achieve loose coupling in Java.
True
False
Two of the steps to process file I/O in Java are _______.
A. Open the file by creating/associating the appropiate objects with I/O source
B. Store the ouput in the file
C. Read/write data to the file
D. A and B
E. A and C
True or False: The ELSE keyword indicates alternative branches in an IF statement.
True
False
What Stream used to read character data from different devices?
A. Character Input
B. Character Output
C. Byte Output
D. Byte Input
A: Nothing; the "finally" portion only gets executed if there is an exception caught
B: inFile is closed
C: inFile can't be closed because it wasn't initialized properly
A. Msg from class One
B. Msg from class Two
C. Msg from class Three
D. Runtime error
A. NullPointerException
B. ArrayIndexOutOfBoundsException
C. StringIndexOutOfBoundsException
D. ClassCastException
E. ArithmeticException
{"name":"Quiz 4 Practice Quiz", "url":"https://www.quiz-maker.com/Q09R0FZ1O","txt":"True or False: Java does not support multiple inheritances with classes., To use an interface in Java, use the keyword ______., Inheritance upcasting is a(n) _____.","img":"https://www.quiz-maker.com/3012/CDN/76-3527175/screen-shot-2022-04-14-at-6-01-17-pm.png?sz=1200"}
Powered by: Quiz Maker