About Question enthuware.ocajp.i.v7.2.1364

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

Moderator: admin

Post Reply
b0risen

About Question enthuware.ocajp.i.v7.2.1364

Post 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.

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

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

Post 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

b0risen

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

Post by b0risen »

Ok, thanks for reply.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post 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.*;

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

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

Post by admin »

Yes, I should have written com.* in my post above. Updated.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests