This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!

Jay Rem

Greenhorn
+ Follow
since Apr 27, 2021
Jay likes ...
Eclipse IDE Python Java
Cows and Likes
Cows
Total received
1
In last 30 days
1
Total given
0
Likes
Total received
1
Received in last 30 days
1
Total given
1
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jay Rem

Norm Radder wrote:Can line 25 ever be executed?
It will when n = 0;


and yes line 25 can be, and was.
1 week ago
The forums here are very helpful. Thanks to everyone who posted and added to the discussion. I had finished the program and made a good grade for it. I'll post the final code here. everything worked as intended with a few adjustments, I changed double to int, and added way more if statements to the code. it ended up being a lot of extra lines, I feel like I could have saved a few lines somehow, but am not sure. Anyway, here it is. Thanks again everyone.
1 week ago

Norm Radder wrote:There are some holes in the if statement tests
if the statement on line 14 is true then the statement on line 16 can never be true.
What is supposed to happen if n is 0, 9 or 10?




I totally understand where you're coming from. After looking at it, but like this it runs. Im gonna look into looping, I guess that's where I need to be at anyway. When I enter 2, or anything between 0 and 9 it runs how it is intended. Try it yourself.
1 week ago
I need help again. I am creating a program, that asks a question, "how much love do you need?". The user adds a number, to how much they need. I need to make the code, say, if the user puts in the number 3, " I love you one time", I love you two times", "I love you three times", and this depends on the number they enter. Can I get some assistance on how to do this, please? I need the number entered to be printed out each time starting at one going all the way up to 9.
Thanks for the help in advance.

1 week ago
I appreciate the help I have gotten this far, it still will not run. I will reach out to my professor and ask for help. I have done all the suggestions and cannot get it yet. I am hopeful though.
2 weeks ago

Carey Brown wrote:Type
It should tell you the current version of the compiler you are using, or give you an error message. If you get an error then there's something wrong with your JDK installation.


here is my version of jdk.
2 weeks ago

Campbell Ritchie wrote:The class should be called HelloMe, not HelloMe.java (line 12).


Thanks for that, I actually had recently changed it as a trial and error process and never changed it back. I have used both with and without .java, Ill remove it and keep trying. Thanks.
2 weeks ago

Campbell Ritchie wrote:Welcome to the Ranch

Please explain how you compiled that code. Did you get any other error messages? It is only possible to use java XYZ.java in (I think) Java10+, not Java8. You need to run the compiler program first:-
javac XYZ.java
java XYZ


I compiled it with "java Hello.Me.java", and I tried "javac Hello.Me.java". When I use javac: 'javac' is not recognized as an internal or external command, when I use java: "error could not find or load main class HelloMe.java.
operable program or batch file.
2 weeks ago
I cannot get this to compile, I am not sure why. I have JDK 8 installed and the correct path set to the environment variables. When I try to compile, with "java HelloMe.java" I get an error, "Error: Could not find or load main class HelloMe.java". This is for a school assignment. I am new to this. thanks if you can help me. Here is the snippet of code, is it written correctly? am I missing something? thanks again for viewing.

2 weeks ago