This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 10909
    
  12

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: 36478
    
  16
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 {}.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My main class will not display my code
 
Similar Threads
I'm trying to run my code through console but the option is not available
Java Newbie in need of assistance, reading lines from text file and calculating averages.
In need of much help with my main method.
Another "Fantastic" Static Method Problem I need help on...
Java Object Oriented Grades Program