1z0-808 Exam QuestionsBrowse all questions from this exam

1z0-808 Exam - Question 16


Given the code fragment from three files:

Which code fragment, when inserted at line 2, enables the code to compile?

Show Answer
Correct Answer: E

To compile the code, you need to import classes from both the 'sales' package and the 'sales.products' package. Specifically, 'SalesMan' is located in the 'sales' package and 'Product' is located in 'sales.products' package. Therefore, the correct code to insert at line 2 is 'import sales.*;' and 'import sales.products.*;'. This will ensure that both 'SalesMan' and 'Product' are available to the 'USMarket' class. The correct option is E.

Discussion

14 comments
Sign in to comment
krkpnrOption: E
Mar 14, 2020

Correct E

DanielLeeeeOption: A
Sep 30, 2021

import sales.*; import sales.products.*; OR import sales.SalesMan; import sales.products.Product;

SamAruOption: E
Jun 29, 2020

Agreeed, Option E is correct!

PD1985Option: E
Sep 28, 2020

Answer is E, but there is a typo for last class. file name mentioned as Market.java however the class name is defined as USMarket.java.

alexandrustefanescuOption: E
Jun 28, 2021

E ist correct!

andiksOption: C
Jul 19, 2021

Import sales* - Imports all classes in sales but sales itself. Correct answer is C

Vicky_65Option: E
Apr 1, 2023

correct anser is E

ddpkOption: C
Jan 22, 2022

Answer C

ddpk
Jan 26, 2022

Sorry it's answer E

ddpkOption: E
Jan 26, 2022

Answer E

Ankit1010Option: E
Feb 7, 2023

E is the correct answer.

dsmsOption: E
Aug 3, 2023

Correct - E

fvelazqueznavaOption: E
Oct 4, 2023

E is the correct

arjunrawatirissoftwareOption: E
Oct 11, 2023

Answer - E

KrokOption: E
Jun 17, 2024

Incorrect question: if class name of public class is USMarket then file can't have name Market.java If we rename public class or file - correct answer "E"