Question: ans the multiple choice ques 1. we are able to - overriding of a final function extend a final class change the value of a
ans the multiple choice ques
1. we are able to -
overriding of a final function
extend a final class
change the value of a final variable
none of these
2. I1, I2, I3 are three interfaces and 'A' is a class, which of the following syntax is/are correct,
class A implements I1, I2, I3{//class code}
interface I3 extends I1, I2{//interface I3 code};
interface I2 extends I1{//interface I2 code};
class A extends I1, I2, I3{//class code}
3. In case of inheritance in java, the following information is/are true-
we can perform multi-level inheritance
the constructor of supper class is called by the name of the super class
sub-class can hold variables of same name as the variables of super-class
we can perform multiple inheritance
4 . in the value of the following(s) can be modified -
values stored in an array
variables of an interface
final variables of a super class from its subclass
non-final variables of a super class from its subclass
5. which of the following can we write in an interfaces?
void function(){}
default void function(){}
public void function(){}
void function();
6. We have class 'A' in package 'pkg1' and class 'B' in package 'pkg2'. If 'B' inherits 'A', 'B' will be able to access the following properties of 'A',
Private
No modifier
Public
Protected
7. which of the following(s) is/are not allowed?
int b[3][4] = new int[ ][ ];
int b[ ][ ] = new int[ ][4];
int b[ ][ ] = new int[3][4];
int b[ ][ ] = new int[3][ ];
8. the arguments passed with command line are
are ' ' (space) separated
cannot be access from main function
stored in "String[] args" array parameter of main function
can only be passed once at the starting of execution
9. overloaded and overridden functions are different with respect to -
the scope where functions are defined
type of function-parameters
name of the functions
number of function-parameters
10. myExep is an user-defined exception that is checked in "func" function. "func" function is called from the main function. Which is/are correct syntax?
myExep function(//parameter){//function code}
void function(//parameter) throw myExcep{//function code}
static void function(//parameter) throws myExcep{//function code}
static myExep function(//parameter){//function code}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
