replace insert imports here to make code compile??

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
sulakshana
Posts: 14
Joined: Thu Dec 22, 2016 8:55 pm
Contact:

replace insert imports here to make code compile??

Post by sulakshana »

Package aquarium.*;
public class Tank{ };

Package aquarium.jellies;
public class jelly{ };

Package visitor;
INSERT IMPORTS HERE
public class AquariumVisitor{
public void admire(Jelly jelly){ } }

There are only two answers..
Answers are import aquarium jellies.jelly; or import aquarium.jellies.*;
How can these imports import public class tank???? That is my question please help..

admin
Site Admin
Posts: 10078
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: replace insert imports here to make code compile??

Post by admin »

why do you want to import Tank if it is not used??
If you like our products and services, please help us by posting your review here.

sulakshana
Posts: 14
Joined: Thu Dec 22, 2016 8:55 pm
Contact:

Re: replace insert imports here to make code compile??

Post by sulakshana »

How to identify required imports and imports not required to import, because there is a option called import aquarium.* which is not taken as a valid answer.....

admin
Site Admin
Posts: 10078
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: replace insert imports here to make code compile??

Post by admin »

This is a very easy topic. You should go through this basic java tutorial to understand this: https://docs.oracle.com/javase/tutorial ... epkgs.html
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests