Why isn't alternativ 2 correct?
"package 'com' does not contain Base." But the class is refered to as enthu.Base.
About Question enthuware.ocpjp.v7.2.1616 :
Moderator: admin
-
- Posts: 20
- Joined: Tue Nov 04, 2014 1:13 am
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1616 :
import statement imports only classes. It does not import sub packages.
So by importing com.*, you will be importing classes that are there directly in the package com. But the class that you need is in package com.enthu.
So by importing com.*, you will be importing classes that are there directly in the package com. But the class that you need is in package com.enthu.
-
- Posts: 15
- Joined: Tue Jan 13, 2015 12:10 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1616 :
Is it correct to import only one class?
Code: Select all
import com.enthu.Base;
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1616 :
What happened when you tried it out?
Who is online
Users browsing this forum: Bing [Bot] and 1 guest