Chan Ag wrote:Can you post the code here?
Post all the lines in the code including the package statement.
Class names or any identifier name in Java cannot have a ".".
You might want to refer to the API docs for more information on
the rules ( what is legal ) and conventions for creating class names and identifier names.
Thanks for your reply.
The below paragraph which i have highlighted is taken from the K&B book where i found some doubt.
Java is a package-centric language; the developers assumed that for good organization and name scoping, you would put all your classes into packages.They were right, and you should. Imagine this nightmare: Three different programmers, in the same company but working on different parts of a project, write a class named Utilities. If those three Utilities classes have not been declared in any explicit package, and are in the classpath, you won't have any way to tell the compiler or JVM which of the three you're trying to reference. Sun recommends that developers use reverse domain names,appended with division and/or project names. For example, if your domain name is geeksanonymous.com, and you're working on the client code for the TwelvePointOSteps program, you would name your package something like com.geeksanonymous.steps.client.
That would essentially change the name of your class to com.geeksanonymous.steps.client.Utilities. You might still have name collisions within your company, if you don't come up with your own naming schemes, but you're guaranteed not to collide with classes developed outside your company (assuming they follow Sun's naming convention, and if they don't, well, Really Bad Things could happen)
The
dark red which i had done is the paragraph which is in the K&B
The
dark blue part which i highlighted is the package name .In that my doubt is the name of the package come's under identifier or not? if identifier we cant use
" . " as i learnt from the legal identifier rules and one more thing if its identifier if i use any number like com.geeksanonymous.steps.1client it is giving error.Y is that wrong according to identifier rules we can use number in between
Coming to class name which i have marked in
green how can they use
" . "?
Please help me over this .
I am struck with this
if i am wrong in understanding the sentence please tell me the correct one
Hoping for your response
Thanks