For Programmers: Free Programming Magazines  


Home > Archive > Java Help > November 2005 > use of uppercase and lowercase in codes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author use of uppercase and lowercase in codes
venkat

2005-11-22, 4:01 am

I am familiar with vba for excel. there you type in any case, the code
staements are automatically changed to correct case. In java
programming it is notdone. Even though I have vague notion when the
case should be upper case is there any rule . for e.g in the statement
String firstname=""
the first s should be upper case

BurfferedReader reader
in the first word B and R upper case but in <reader? r is lower case.

where can I get such information.

sorry this is a qustion from an absolute beginner in Java programming
and plead for your indulgence. thanks regars.

Hal Rosser

2005-11-22, 4:01 am


"venkat" <venkat1926@yahoo.com> wrote in message
news:1132630832.601003.231500@f14g2000cwb.googlegroups.com...
> I am familiar with vba for excel. there you type in any case, the code
> staements are automatically changed to correct case. In java
> programming it is notdone. Even though I have vague notion when the
> case should be upper case is there any rule . for e.g in the statement
> String firstname=""
> the first s should be upper case
>
> BurfferedReader reader
> in the first word B and R upper case but in <reader? r is lower case.
>
> where can I get such information.
>
> sorry this is a qustion from an absolute beginner in Java programming
> and plead for your indulgence. thanks regars.
>

I'm almost afraid to answer, because I do make mistakes- but as a general
rule:
Most method names (call them 'identifiers') begin with lower case letters,
and use 'mixed case' capitalization. By that I mean if the method name is a
composite of more than one word, that the first letter of each word is
capitalized after the first word. Same for variables. But Class names begin
with upper case letters. . Constants are usually ALL_CAPS with words
separated by underscores.



venkat

2005-11-22, 4:01 am

thanks very much. some clearing of cobwebs isstarting. I understand the
difficulty. I am writing this more to clarify my thoughts.
In seraching this newsgroup I understood that classname in java code
(first line) and the file name should match exactly, I presume, in the
context of letter cases also
In one of my experimental programme I have a class called <name> and
the file name is <name.java> it works.

Hal Rosser

2005-11-22, 4:01 am

> In one of my experimental programme I have a class called <name> and
> the file name is <name.java> it works.
>

Just for the xxx of it - the name of the class should be capitalized
<Name> rather than <name> , its a convention to Capitalize the class name.
Its really stuck to by many java folk, and by not using caps for class names
is like fingernails on the blackboard for some.


venkat

2005-11-22, 4:01 am

thank you. shall keep in mind

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com