Java Programming Fundamentals Practice Test

Time: 00:00:00
0
Attempted
25
Not Attempted
0
Marked For Review
0
Attempted & Reviewed

Question 1 of 25

What will be the output of the program?

class Super
{ 
    public int i = 0; 

    public Super(String text) /* Line 4 */
    {
        i = 1; 
    } 
} 

class Sub extends Super
{
    public Sub(String text)
    {
        i = 2; 
    } 

    public static void main(String args[])
    {
        Sub sub = new Sub(Hello); 
        System.out.println(sub.i); 
    } 
}
Select Your Answer:

All Questions

Attempted
Not Attempted
Marked for Review
Attempted & Reviewed
Current