C:\Documents and Settings\Lalitha\Desktop\Satti\Tenkai\Computer\Java\SCJD\CodeHelp\someThing.java:3: cannot access WeakHashMap
bad class file: .\WeakHashMap.java
file does not contain class WeakHashMap
Please remove or make sure it appears in the correct subdirectory of the classpath.
WeakHashMap map;
^
1 error
Tool completed with exit code 1
BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Originally posted by Don Wood:
Hi Satish,
There's not enough information in the post for me to be sure but judging from the error message, .bad class file: .\WeakHashMap.java, it looks to me like the name of the file is WeakHashMap.java but the name of the public class is different (someThing).
The whole class is that only. I just wrote if for testing purposes. And the error posted is the whole error.
If this is indeed the problem, you need to use a different file name since you should not have a class the same name as one in the sdk. Whatever the file name is the public class or interface name must exactly match
Really, I just laughed out for sometime when reading this. Sorry about that. Yeah, I know that we should not use any class names that match with SDK. I know you just want me to make sure that whether am sticking for this rule. Thanks for the concern.
C:\Documents and Settings\Lalitha\Desktop\Satti\Tenkai\Computer\Java\SCJD\CodeHelp\WeakHashMapTest.java:4: cannot access WeakHashMap
bad class file: .\WeakHashMap.java
file does not contain class WeakHashMap
Please remove or make sure it appears in the correct subdirectory of the classpath.
WeakHashMap map;
^
1 error
Tool completed with exit code 1
BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Originally posted by Billy Tsai:
u can just use java.util.HashMap or HashTable to handle such thing
Originally posted by Billy Tsai:
u can just use java.util.HashMap or HashTable to handle such thing
If this is indeed the problem, you need to use a different file name since you should not have a class the same name as one in the sdk. Whatever the file name is the public class or interface name must exactly match
Really, I just laughed out for sometime when reading this. Sorry about that. Yeah, I know that we should not use any class names that match with SDK. I know you just want me to make sure that whether am sticking for this rule. Thanks for the concern.
Originally posted by Don Wood:
So you laughed about my comment not to use sdk supplied names and that turned out to be the problem? Hmmmmm.
can you deal with client crashes when you have the assignment where you have to return long lockCookie, so you cannot pass reference of client then can you? Could someone of you please explain me how to do this if you have this assignment with the long lockcookie?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |