Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Sarah Jane

Greenhorn
+ Follow
since Nov 18, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sarah Jane

Edit:
Soo.. I got the program to run as the following:



The only problem is that this is the output: ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789

I was expecting three random letter characters and three random number characters. Yikes.
9 years ago

Ulf Dittmer wrote:You're calling the license method with no parameters, but the method is declared to take a String[] as parameter. Seeing that the method does not actually use the args parameter, you could remove that from the method declaration.

It looks like you're calling the license method recursively from within itself, though - that will cause problems at runtime. Specifically, you will see no output at all, and at some point the JVM will terminate with an error.



Thanks for your response, Ulf. This is my first time using "char" and feel like it's really screwing up my over all approach (maybe it's just my lack of sleep). I made some changes based on what I understood (think I understood) from your comments. The program now complies, but it gives me the following error when I attempt to run it: "Exception in thread "main" java.lang.NoSuchMethodError: main"



I'm so confused that I don't know what I'm confused about. I think my biggest issue is getting it to output? I don't know what to tell it to do despite hours of lectures and following the text book. I feel like a massive dolt.

Edit to ad: I did see what you meant about Args since there aren't any arguments, but I forget to remove it. It shouldn't result in the program running any differently should it? It just isn't needed.


9 years ago
Sooo.. my program wont compile. I'm getting this error message from hell:

license(java.lang.String[]) in Lic1 cannot be applied to ()
System.out.println(license());
^



Can someone give a poor java newbie a clue? Thanks so much! This site seems like a great resource.

9 years ago