Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

OOP (LEC) - FA 4

QuestionAnswer
An interface is typically used in place of an abstract class when there is no default implementation to inherit. Group of answer choices false true An interface is typically used in place of an abstract class when there is no default implementation to inherit. Group of answer choices false true //
What does the name Polymorphism translate to? Group of answer choices Many changes two forms liquid forms Many forms What does the name Polymorphism translate to? Group of answer choices Many changes two forms liquid forms Many forms//
Polymorphism is possible in JAVA language. Group of answer choices False True Polymorphism is possible in JAVA language. Group of answer choices False True//
Polymorphism is a feature of object oriented programming. Group of answer choices False True Polymorphism is a feature of object oriented programming. Group of answer choices False True//
Polymorphism enables objects of different classes that are related by a class hierarchy to be processed generically Group of answer choices true false Polymorphism enables objects of different classes that are related by a class hierarchy to be processed generically Group of answer choices true// false
Which of the following classes fail to compile? abstract class X { abstract void method(); } abstract class Y extends X { void Method() { } } class Z extends X { void method() { } } Group of answer choices X Y All classes compile Z Which of the following classes fail to compile? abstract class X { abstract void method(); } abstract class Y extends X { void Method() { } } class Z extends X { void method() { } } Group of answer choices X Y X All classes compile Z X
Which among the following is not a level of abstraction? Group of answer choices Physical level External level View level Logical level Which among the following is not a level of abstraction? Group of answer choices Physical level X External level View level Logical level
What is an exception? Group of answer choices Problem in syntax Problem in IDE Problem arising during runtime Problem arising during compile time What is an exception? Group of answer choices Problem in syntax Problem in IDE Problem arising during runtime// Problem arising during compile time
Which among the following is not a method of Throwable class? Group of answer choices public Throwable getCause() public String getMessage() public Char toString() public void printStackTrace() Which among the following is not a method of Throwable class? Group of answer choices public Throwable getCause() public String getMessage() public Char toString() // public void printStackTrace()
Which of the following is correct? Group of answer choices All classes of Error extend from Exception. All classes of Exception extend from Error. All classes of Throwable extend from Exception All classes of Exception extend from Throwable. Which of the following is correct? Group of answer choices All classes of Error extend from Exception. All classes of Exception extend from Error. All classes of Throwable extend from Exception All classes of Exception extend from Throwable. //
Encapsulation is supported by ___________ Group of answer choices None of the above Classes Methods Objects Encapsulation is supported by ___________ Group of answer choices None of the above Classes // Methods Objects
If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called? Group of answer choices Overloading Inheritance Overriding Polymorphism If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called? Group of answer choices Overloading Inheritance Overriding Polymorphism //
If a subclass reference is assigned to a superclass variable, the variable must be cast back to the subclass before any subclass methods can be called with it. Group of answer choices true false If a subclass reference is assigned to a superclass variable, the variable must be cast back to the subclass before any subclass methods can be called with it. Group of answer choices true // false
What are the two types of Polymorphism? Group of answer choices Syntax and runtime derive and base Constructor and method encapsulation and Inheritance What are the two types of Polymorphism? Group of answer choices Syntax and runtime X derive and base Constructor and method encapsulation and Inheritance
Abstraction can apply to ____________ Group of answer choices Control and data Only control Only data Classes Abstraction can apply to ____________ Group of answer choices Control and data // Only control Only data Classes
Higher the level of abstraction, higher are the details. Group of answer choices True False Higher the level of abstraction, higher are the details. Group of answer choices True False //
Using higher degree of abstraction __________ Group of answer choices May get unsafe May reduce readability Can increase vulnerability Can be safer Using higher degree of abstraction __________ Group of answer choices May get unsafe May reduce readability Can increase vulnerability Can be safer //
Which of the following classes fail to compile? class X { } abstract class Y { } class Z { abstract void method(); } Group of answer choices X, Y, Z Y Z X Which of the following classes fail to compile? class X { } abstract class Y { } class Z { abstract void method(); } Group of answer choices X, Y, Z Y Z // X
What is an exception? Group of answer choices Problem in syntax Problem in IDE Problem arising during runtime Problem arising during compile time What is an exception? Group of answer choices Problem in syntax Problem in IDE Problem arising during runtime// Problem arising during compile time
Which among the following is not a method of Throwable class? Group of answer choices public Throwable getCause() public String getMessage() public Char toString() public void printStackTrace() Which among the following is not a method of Throwable class? Group of answer choices public Throwable getCause() public String getMessage() public Char toString() // public void printStackTrace()
Which of the following is correct? Group of answer choices All classes of Error extend from Exception. All classes of Exception extend from Error. All classes of Throwable extend from Exception All classes of Exception extend from Throwable. Which of the following is correct? Group of answer choices All classes of Error extend from Exception. All classes of Exception extend from Error. All classes of Throwable extend from Exception All classes of Exception extend from Throwable. //
Encapsulation is supported by ___________ Group of answer choices None of the above Classes Methods Objects Encapsulation is supported by ___________ Group of answer choices None of the above Classes // Methods Objects
If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called? Group of answer choices Overloading Inheritance Overriding Polymorphism If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called? Group of answer choices Overloading Inheritance Overriding Polymorphism //
If a subclass reference is assigned to a superclass variable, the variable must be cast back to the subclass before any subclass methods can be called with it. Group of answer choices true false If a subclass reference is assigned to a superclass variable, the variable must be cast back to the subclass before any subclass methods can be called with it. Group of answer choices true // false
What are the two types of Polymorphism? Group of answer choices Syntax and runtime derive and base Constructor and method encapsulation and Inheritance What are the two types of Polymorphism? Group of answer choices Syntax and runtime X derive and base Constructor and method encapsulation and Inheritance X
Abstraction can apply to ____________ Group of answer choices Control and data Only control Only data Classes Abstraction can apply to ____________ Group of answer choices Control and data // Only control Only data Classes
Higher the level of abstraction, higher are the details. Group of answer choices True False Higher the level of abstraction, higher are the details. Group of answer choices True False //
Using higher degree of abstraction __________ Group of answer choices May get unsafe May reduce readability Can increase vulnerability Can be safer Using higher degree of abstraction __________ Group of answer choices May get unsafe May reduce readability Can increase vulnerability Can be safer //
Examine the following code: String str = "Hot Java"; boolean switch = str instanceof String; What value is placed in switch? Group of answer choices null true "Hot Java" false Examine the following code: String str = "Hot Java"; boolean switch = str instanceof String; What value is placed in switch? Group of answer choices null true // "Hot Java" false
Abstraction principle includes___________ Group of answer choices Use abstraction whenever possible to achieve OOP Use abstraction at its minimum Use abstraction whenever possible to avoid duplication Use abstraction to avoid longer codes Abstraction principle includes___________ Group of answer choices Use abstraction whenever possible to achieve OOP X Use abstraction at its minimum Use abstraction whenever possible to avoid duplication Use abstraction to avoid longer codes
What are two exception classes in hierarchy of java exceptions class? Group of answer choices Other exceptions Runtime exceptions and other exceptions Runtime exceptions only Compile time exceptions only What are two exception classes in hierarchy of java exceptions class? Group of answer choices Other exceptions Runtime exceptions and other exceptions // Runtime exceptions only Compile time exceptions only
Which of these is a super class of all errors and exceptions in the Java language? Group of answer choices Catchable RunTimeExceptions None of the above Throwable Which of these is a super class of all errors and exceptions in the Java language? Group of answer choices Catchable RunTimeExceptions None of the above Throwable //
What is the only type of exception that is NOT checked? Group of answer choices Class IOException and its subclasses. Class ArithmeticException only. Class RunTimeException and its subclasses. Class Exception. What is the only type of exception that is NOT checked? Group of answer choices Class IOException and its subclasses. Class ArithmeticException only. Class RunTimeException and its subclasses. // Class Exception.
Program throws ___________ if assert statement fails. Group of answer choices java.lang.AssertError java.lang.AssertionError java.lang.AssertException java.lang.AssertionException Program throws ___________ if assert statement fails. Group of answer choices java.lang.AssertError java.lang.AssertionError // java.lang.AssertException java.lang.AssertionException
Which type of function among the following shows polymorphism? Group of answer choices Virtual function Class member functions Undefined functions Inline function Which type of function among the following shows polymorphism? Group of answer choices Virtual function // Class member functions Undefined functions Inline function
An abstract class cannot have instance data and non-abstract methods. Group of answer choices false true An abstract class cannot have instance data and non-abstract methods. Group of answer choices false // true
If a class leaves one method in an interface undeclared, the class is implicitly declared by Java as an abstract class. Group of answer choices true false If a class leaves one method in an interface undeclared, the class is implicitly declared by Java as an abstract class. Group of answer choices true false //
Encapsulation and abstraction differ as ____________ Group of answer choices Binding and Hiding respectively Hiding and hiding respectively Can be used any way Hiding and Binding respectively Encapsulation and abstraction differ as ____________ Group of answer choices Binding and Hiding respectively // Hiding and hiding respectively Can be used any way Hiding and Binding respectively X
Which is the universal exception handler class? Group of answer choices Object Errors Math Exceptions Which is the universal exception handler class? Group of answer choices Object X Errors Math Exceptions
If the Java program is using assertions, it must be run with -ea or -enableassertions switches. Group of answer choices True False If the Java program is using assertions, it must be run with -ea or -enableassertions switches. Group of answer choices True False //
Which among the following can't be used for polymorphism? Group of answer choices Constructor overloading Static member functions Predefined operator overloading Member functions overloading Which among the following can't be used for polymorphism? Group of answer choices Constructor overloading Static member functions // Predefined operator overloading Member functions overloading
What method of an Exception object returns a message string? Group of answer choices printMessage() getError() traceMessage() getMessage() What method of an Exception object returns a message string? Group of answer choices printMessage() getError() traceMessage() getMessage() //
Why do we need to handle exceptions? Group of answer choices To prevent abnormal termination of program To encourage exception prone program To avoid syntax errors To save memory Why do we need to handle exceptions? Group of answer choices To prevent abnormal termination of program // To encourage exception prone program To avoid syntax errors To save memory
Created by: thecavillator
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards