A. Consider the class declaration below: public class A extends B implements C W
ID: 3710631 • Letter: A
Question
A. Consider the class declaration below: public class A extends B implements C Which ones of the following statements are valid, and which ones are invalid? A var - new B() Valid or Invalid A var - new CO; Valid or Invalid B var -new AO; Valid or Invalid B var = new C(); Valid or Invalid C var -new AO; Valid or Invalid C var - new B(); Valid or Invalid B. An exception is checked if it is caught by a try/catch block. True or False C. Once an exception is caught, the application resumes from the point where the exception was thrown. True or False D. Adding elements to a BinarySearchTree in increasing order will produce a balanced tree True or False E. The depth of a balanced binary tree of size n is logo n True or FalseExplanation / Answer
public class A extends B implements C{
}
A var. = new B()
Invalid as its incompatible because A can only create a variable of its own class or child class.
A var = new C()
Invalid
C is abstract that means C is interface so it can not be instantiated.
B var = new A()
Valid
As A is child class of a B so Class B can instantiate a variable of child class B
B var = new C()
Invalid
C is abstract that means C is interface so it can not be instantiated.
C var = new A()
Valid
Because A implement the class C so C class can instantiate the variable of the class A
C var = new B()
Incompatible type
As class C can instantiate the variable only of the class which has implement it.
B An. Exception is checked if it is caught by a they/catch block
Answer: True
Because checked exceptions are those exception which force the developer to cash them in the try catch block.
C Once an exception is caught the application resumes from the point where the exception was thrown
Answer
True
Exception main function is to catch the error while program or application is running and avoid the error which is going to occur n the program. So after exception get caught it resume
The application from the point where the exception was thrown.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.