Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
Error message: not public in java. can't be accessed from outside package
Maureen Charlton
Ranch Hand
Posts: 218
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
MainProgram.java:120: java.util.HashMap.Entry is not public in
java
.
; cannot be accessed from outside package
HashMap.Entry entry = (HashMap.Entry)iterator2.next( );
Is anyone able to explain to me what this is actually saying?
Alain Boucher
Ranch Hand
Posts: 51
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hashmap.class:
public class HashMap extends AbstractMap implements Map, Cloneable,
java.io.Serializable {
/**
* The hash table data.
*/
private transient Entry table[];
etc...
Entry is private... you cannot use Hashmap.Entry because you are not in a method in the Hashmap class, this field is private to that class
The Entry class is a Inner class of HashMap, so it is for internal use only (because of private)
Only use public method to get your data
Alain Boucher<br />Spare-Brain Consultants Inc.<br />SCJ2P,SCWCD,
Maureen Charlton
Ranch Hand
Posts: 218
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Alan
- thanks for this. Much appreciated.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Access modifiers (very simple Q)
String.intern()-regd
Protected
Public Members access
Package Statement.
More...