aspose file tools*
The moose likes Beginning Java and the fly likes My main class will not display my code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "My main class will not display my code" Watch "My main class will not display my code" New topic
Author

My main class will not display my code

kenny gill
Ranch Hand

Joined: Mar 12, 2012
Posts: 54

I'm trying to display 15 project and 10 quiz scores but they're not displaying at all in the console

My student class:





MAIN Class:



fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11411
    
  16

kenny gill wrote:
I'm trying to display 15 project and 10 quiz scores but they're not displaying at all in the console

What IS it doing?

Most people are not going to try going through 250 lines of code to figure that out. Your job is to make it EASY for us to help you.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
kenny gill
Ranch Hand

Joined: Mar 12, 2012
Posts: 54

The problem is that the console is not displaying a single thing. It should be displaying a few project and quiz scores I have entered but nothing is displaying; the screen is empty

I don't know fix this problem.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You're never setting any project score or quiz score. This will cause to make both getProjectScoreForid and getQuizScoreForid return "".


[My Blog]
All roads lead to JavaRanch
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39409
    
  28
It isn’t 250 lines of code, Fred, but 250 lines of mostly blank space.
KG: please indent your code correctly, get rid of most of those blank lines, and post it again. You will find it so much easier to read and understand.
Make your inequalities simple. It is much easier to read i < j that i <= j - 1. And much less error‑prone.
Have you still got the constructor in the form you posted originally? There is a very serious error in it, which many beginners make. Actually there is a second error in that constructor.
Use for loops preferentially for iterating arrays. Use the conventional form of the for loop for (int i = 0; i < array.length; i++){//...}, not forgetting the {}.
 
jQuery in Action, 2nd edition
 
subject: My main class will not display my code