The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes access control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "access control" Watch "access control" New topic

access control

aruna ver

Joined: Jun 24, 2002
Posts: 8
in the following code
package f1;
public class F1{}
package f2;
public class F2 extends F1{}

the ans given was
3) The code for F1 will compile but the code for F2 will not compile
why connot F2 see the class F1
i think F1 is public so it should be accessble even it is in differnt package
can any body help me out here
Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
i think there should be an import statement!!!
import f1.F1
Sarma Lolla
Ranch Hand

Joined: Oct 21, 2002
Posts: 203

i think there should be an import statement!!!
import f1.F1

Please observe the missing semicolon at the end of import statement.
It should be import f1.F1;
Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
picky, picky Sarma!
but the exam requires attention to detail like that!

giddee up
I agree. Here's the link:
subject: access control
It's not a secret anymore!