www.HadoopExam.com

HadoopExam Learning Resources

Following are the Oracle Java and Oracle SQL Products Provided by HadoopExam Learning Resources
Free Core Java 1Z0-808 Training Java 1Z0-808 Questions and Answers Java 1Z0-809 Questions and Answers Questions for Oracle 1Z0-060 : Upgrade to Oracle Database 12c Administrator Oracle Database 12c: SQL Fundamentals

Question 12: You have been given below code. Please select the correct options, which applies to this code.

Question 12: You have been given below code. Please select the correct options, which applies to this code.

package com.hadoopexam;

class Parent {

public void printValue() {

System.out.println("It is a Parent Class");

}

}

abstract class Child extends Parent { // n1

public static void main(String[] args) {

Parent obj = new Parent();

obj.printValue (); // n2

}

}

1. You cannot have an abstract class which can extend non abstract class. Hence, it will give compile time error.

2. Parent class printValue() method is not accessible from a child class.

3. Program will compile successfully and also run perfectly with  "It is a Parent Class".

4. There will be a RuntimeError. As child class is an abstract class.

Correct Answer : 3 Exp : Abstract class can extend a non abstract class. Ans abstract class can have a main() method, which is static. 

I have cleared my Java 1Z0-808 Certification exam with 92% using this simulator

 

I have cleared my Java 1Z0-809 Certification exam with 96% using this simulator

You have no rights to post comments

You are here: Home Oracle Java 1Z0-809 Question 12: You have been given below code. Please select the correct options, which applies to this code.