Multiple choice in java Given the following code snippet:          ArrayList shapes = new ArrayList<>();         Scanner scan1=new Scanner(new File("D:\\AAUJ\\AAA\\radiusInfo.txt")); //This statement is equivalent to Scanner scan1=new Scanner(new FileInputStream("D:\\AAUJ\\AAA\\radiusInfo.txt"));         while(scan.hasNext())         {             double radius;             scan.next();             radius=Double.parseDouble(scan.next());             shapes.add(new Circle(radius));         } Select one: a. The compiler will report an error if Shape class does not extend Circle class b. The compiler will report an error

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Multiple choice in java

Given the following code snippet: 

        ArrayList<Shape> shapes = new ArrayList<>();

        Scanner scan1=new Scanner(new File("D:\\AAUJ\\AAA\\radiusInfo.txt")); //This statement is equivalent to Scanner scan1=new Scanner(new FileInputStream("D:\\AAUJ\\AAA\\radiusInfo.txt"));

        while(scan.hasNext())

        {

            double radius;

            scan.next();

            radius=Double.parseDouble(scan.next());

            shapes.add(new Circle(radius));

        }

Select one:
a.

The compiler will report an error if Shape class does not extend Circle class

b.

The compiler will report an error

c.

The compiler will report an error if Circle class does not extend Shape class

d.

None of these

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT