Click here to Skip to main content
15,907,910 members
Home / Discussions / Java
   

Java

 
AnswerRe: Profile visits using FB api Pin
Nagy Vilmos2-Dec-10 1:10
professionalNagy Vilmos2-Dec-10 1:10 
GeneralRe: Profile visits using FB api Pin
TorstenH.2-Dec-10 2:39
TorstenH.2-Dec-10 2:39 
Questionhow to write this code Pin
atoivan2-Dec-10 0:28
atoivan2-Dec-10 0:28 
AnswerRe: how to write this code Pin
Nagy Vilmos2-Dec-10 0:37
professionalNagy Vilmos2-Dec-10 0:37 
AnswerRe: how to write this code Pin
TorstenH.2-Dec-10 2:44
TorstenH.2-Dec-10 2:44 
AnswerRe: how to write this code Pin
CodingLover2-Dec-10 23:43
CodingLover2-Dec-10 23:43 
QuestionRe: how to write this code Pin
atoivan3-Dec-10 15:44
atoivan3-Dec-10 15:44 
AnswerRe: how to write this code Pin
TorstenH.5-Dec-10 20:52
TorstenH.5-Dec-10 20:52 
Do NOT set variable names with capital letter (see "int Da"). Names starting with capital letter are objects.

And do use an own counter for each loop. Otherwise you're in big trouble faster than you can imagine (might have happen here already..)
for (int iCount=0; iCount < name.length; iCount++ ) {
System.out.printf( "%5d\t%8d\n", iCount, name[iCount] );
}


Other points:

- i see a member "n" declared right on top. Where is it initialized? Do not make it "public static" - thats bad style. Set it "private final".

- use empty lines to give structure to your code. It stays readable and you in control. Also set some comments - just to tell yourself what is supposed to happen.

And finally your question:
You are not in a loop while entering the names. I suggest to take id and name of the student one at a time. And think of a object "student". It would make your task much easier.

regards
Torsten
I never finish anyth...

QuestionRe: how to write this code Pin
atoivan3-Dec-10 15:55
atoivan3-Dec-10 15:55 
AnswerRe: how to write this code Pin
Dr.Walt Fair, PE3-Dec-10 16:34
professionalDr.Walt Fair, PE3-Dec-10 16:34 
QuestionRe: how to write this code Pin
atoivan3-Dec-10 16:49
atoivan3-Dec-10 16:49 
AnswerRe: how to write this code Pin
Dr.Walt Fair, PE3-Dec-10 16:58
professionalDr.Walt Fair, PE3-Dec-10 16:58 
AnswerRe: how to write this code Pin
LloydA1113-Dec-10 1:33
LloydA1113-Dec-10 1:33 
GeneralRe: how to write this code Pin
Nagy Vilmos3-Dec-10 3:57
professionalNagy Vilmos3-Dec-10 3:57 
GeneralRe: how to write this code Pin
LloydA1113-Dec-10 4:01
LloydA1113-Dec-10 4:01 
GeneralRe: how to write this code Pin
TorstenH.5-Dec-10 20:54
TorstenH.5-Dec-10 20:54 
Questionweb service client Pin
asha_s30-Nov-10 0:50
asha_s30-Nov-10 0:50 
AnswerRe: web service client Pin
427748030-Nov-10 16:26
427748030-Nov-10 16:26 
GeneralRe: web service client [modified] Pin
asha_s1-Dec-10 1:50
asha_s1-Dec-10 1:50 
GeneralRe: web service client Pin
asha_s3-Dec-10 7:42
asha_s3-Dec-10 7:42 
GeneralRe: web service client Pin
asha_s5-Dec-10 0:05
asha_s5-Dec-10 0:05 
QuestionjFuzzy logic or Matlab Pin
mesho27-Nov-10 7:37
mesho27-Nov-10 7:37 
AnswerRe: jFuzzy logic or Matlab Pin
Dr.Walt Fair, PE27-Nov-10 8:41
professionalDr.Walt Fair, PE27-Nov-10 8:41 
AnswerRe: jFuzzy logic or Matlab Pin
427748029-Nov-10 20:14
427748029-Nov-10 20:14 
QuestionFlatten or Merge PDF with PDFBox Pin
GlobX25-Nov-10 19:08
GlobX25-Nov-10 19:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.