Win a copy of Java by Comparison (eBook) this week in the Java in General forum!

Rudolph Ten

+ Follow
since Jan 23, 2002
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rudolph Ten

i am creatin a small application...mostly to learn java....
I now want to get into databases and java...
I need to select one...
MySql or Cloudscape?
Any advice on which to pick?
How do i create a Jtable without cell selection?
How do i make so cells are tranparent to user.....not editable......
user can only select row...not cell....
Newbie to Java here....
16 years ago
What is the Best way to determine the number of lines in a file to process in Java....
These files have over 100,000 lines.....
I wanted to do a count so then i can calculate and show the percentage done processed.....
currently i do 2 passes at file...
I read every record to get a total line count.
Once i have this count....i re-read file again to process each record individually
Both passes are slow.....
But on FIRST PASS.....IS there a way to figure out how many lines my file has? Or a faster way to read them for count?(on first pass)
Java Newbie
16 years ago
Is a set of X IF statements more efficient then a Switch Statement with X cases in it? are they the same?
16 years ago
Does Java have an equivalent of a COBOL Evaluate Statement?
Lets say I want to keep track of Grades.
I would Evaluate Each GRADE for to bottom....once found would exit.
Evalute True
....When Grade = "A"
Add 1 to A-cnt.
....When Grade = "B"
Add 1 to B-cnt.
....When Grade = "C"
Add 1 to C-cnt.
....When Grade = "D"
Add 1 to D-cnt.
....When Other
Add 1 to Invalid-grade-cnt.
If/else statemnts in Java are Ugly to me(maybe cause i am knew to it)....having trouble knowing whats if applies to what... and yes.... i am aligning my 'if's, 'else's, '{'s, '}'s. Am also using comments....but....
I miss END-IF Statement....
16 years ago
Thanks, both posts helped....pointed out to me what to read up on worked
16 years ago
Not sure how to store this info....
in java...
String Array[i];
-----------can hold humans1-10
String Array[i][j];
-----------i can hold humans1-10(i row)
-----------j can hold gender M or F(j coloumn)

lets say:
I have a list of 10 humans, for each human I want to hold name, gender, eye color, names and age of kids(a human can have more then one kid. Up to 5 kids)
In COBOL I would create and Array of humans(occurs 10 time). This array would store name, eye color, and a sub-array (a lower level occurs that occurs 5 times) that would store the kid information.
01 humans occurs 10 times.
...05 human-name pic x(30).
...05 human-gender pic x(01).
...05 human-eye-color pic x30).
...05 human-kids occurs 5 times.
......07 kid-name pic x(30).
......07 kid-age pic 9(02).

How is this done in java?
[ January 24, 2002: Message edited by: Rudolph Ten ]
16 years ago
Is it possible to choose the line I want to start reading the file from? I am new to java.

I was using this code:
while((s = br.readLine()) != null) {
Thanks in advance
16 years ago