wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 11168
    
  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: 14687
    
  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: 38045
    
  22
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 {}.
 
 
subject: My main class will not display my code
 
Similar Threads
Another "Fantastic" Static Method Problem I need help on...
Java Newbie in need of assistance, reading lines from text file and calculating averages.
Java Object Oriented Grades Program
In need of much help with my main method.
I'm trying to run my code through console but the option is not available