Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1364

Posted: Fri Jan 18, 2013 6:15 am
by b0risen
Given the following class, which of these are valid ways of referring to the class from outside of the package com.enthu?

Code: Select all

package com.enthu; 
public class Base{    
        // ....    
        // lot of code... 
}
I think that second answer may be also true or description of this answer is invalid:
By importing the package com.* and referring to the class as enthu.Base
package 'com' does not contain Base.

Re: About Question enthuware.ocajp.i.v7.2.1364

Posted: Fri Jan 18, 2013 1:01 pm
by admin
Second option is not correct because if you do import com.*; that means you are importing the classes in package com. But class Base is not in package com. It is in package com.enthu.

HTH,
Paul

Re: About Question enthuware.ocajp.i.v7.2.1364

Posted: Mon Jan 21, 2013 2:27 am
by b0risen
Ok, thanks for reply.

Re: About Question enthuware.ocajp.i.v7.2.1364

Posted: Sun Nov 04, 2018 6:03 am
by flex567
Second option is not correct because if you do import com;
But there is no

Code: Select all

import com;
in the answers but only

Code: Select all

import com.*;

Re: About Question enthuware.ocajp.i.v7.2.1364

Posted: Sun Nov 04, 2018 6:11 am
by admin
Yes, I should have written com.* in my post above. Updated.