• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access control

 
aruna ver
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
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
thanks
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think there should be an import statement!!!
::::
import f1.F1
 
Sarma Lolla
Ranch Hand
Posts: 203
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 284
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
picky, picky Sarma!
but the exam requires attention to detail like that!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic