Page 1 of 1

replace insert imports here to make code compile??

Posted: Mon Jan 09, 2017 10:04 pm
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..

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

Posted: Mon Jan 09, 2017 11:30 pm
by admin
why do you want to import Tank if it is not used??

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

Posted: Tue Jan 10, 2017 11:11 am
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.....

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

Posted: Wed Jan 11, 2017 12:25 am
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