• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Package Declarations.Import Statements

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there. I am having real diffiuclty with the majority if note all SCJP mock questions concerning package declarations and import statements. It's driving me mad and I have my exam on Friday!!

Can someone please give me some definitive rules about accessing class members from outside a class within a particular package.

E.g.

Package a;

class A {
int x = 6;

public void doStuff() {}
}//End class A

package different;

import a.A;

class B {

//this is where I get stuck or seem to always pick the right a wrong answers!
//What are the declaration rules for accessing the class members for class A and what
//is the actual point of the import statement?? I know this sounds stupid but I cannot find an
//explanation that seems to be clear

}

Thanks in advance. The more explicit the answer the better in my case!!

Cheers

Wayne
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a question about basics and I don't think you need any tailored answers. You can check the sun tutorial at http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html

Make a note of the access table and scan it in your brain
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic