| Author |
Iterator
|
maggie joseph
Ranch Hand
Joined: Dec 29, 2009
Posts: 185
|
|
i want to get the values of Principal and BillMonthYear ..how do i access the values...I am getting values as 0...
what do i put in lines 1,2 till line 5....??
thanks
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
1. Please indent your code properly, its almost unreadable.
2. The while loop that starts on line 49 ends at line 62, so if there are 3 rows in the database, you'll get 6 outputs (because the iterator will run with each row in the database)
3. You are only displaying the value of variable in the while loop which you never set so you'll get 0 as output. If you want the values of billMonthYear and principal, then you can change the code in the second while loop to
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Harpreet Singh janda
Ranch Hand
Joined: Jan 14, 2010
Posts: 317
|
|
|
Instance variables are always automatically initialized to default values and for the float the default value is 0. As you are not setting the value of "variable" so by default it's value will be 0.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12952
|
|
This question doesn't look like it has anything to do with the SCJP exam. I will move it to a more appropriate forum for you.
Please CarefullyChooseOneForum when you post a question.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Iterator
|
|
|