Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My main class will not display my code

 
kenny gill
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 12146
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
kenny gill
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're never setting any project score or quiz score. This will cause to make both getProjectScoreForid and getQuizScoreForid return "".
 
Campbell Ritchie
Sheriff
Pie
Posts: 49403
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 {}.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic