Please provide full error message, also post move to Java section....
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
are you sure you passed a parameter in your run command prompt when you run the prog?
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
final char grade;
Declaring a variable as "final" is almost like making it a constant and hence its value cannot be changed later (which you are doing in the "if else" blocks.
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154
final char grade;
Declaring a variable as "final" is almost like making it a constant and hence its value cannot be changed later (which you are doing in the "if else" blocks.
I guess I was wrong on that call, I had the opinion that you need to specify the value for the "final" variables during declaration itself, but when I compiled and ran the code I got the output:-
stephen@steve:~/Development/java/daniweb> java Grade 61
The grade is D.
stephen@steve:~/Development/java/daniweb>
So I guess the only problem is as stultuske suggested, you are not specifying the command line argument of marks correctly.
stephen84s
Nearly a Posting Virtuoso
1,443 posts since Jul 2007
Reputation Points: 668
Solved Threads: 154