Quentin Harris

Greenhorn
+ Follow
since Jan 22, 2017
Merit badge: grant badges
For More
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Quentin Harris

Thanks guys.

It was my lack of knowledge about System.in and the fact the code example given to complete only indicated one line was required.
While true, it meant there was no text indication at the bottom that i should enter something. The program was waiting for me to pass input as mentioned in the comments above.

I did some homework using,  i think, more useful Youtube videos.  These were more explicit with expected terminology, structure and known common newbie mistakes.

Best wishes,

Q
7 years ago

Thanks for the explanation regarding .close.

The echo text worked fine. I just wasn't sure why the code wasn't running until i made your amendment.

Did it not run because i wasn't passing anything initially via System.in?

As the test required the input of only one code line i'm somewhat bemused.

Q

7 years ago
@Campbell Ritchie:

As an aside - All the learning materials on this course, i have seen so far, use scanner.close or something similar.

Why is this wrong please?

Many thanks,

Quentin
7 years ago
Thanks for the replies. I entered code as below taking on board the suggestions. It prints only after i have entered some text to echo and then gives me the hello world followed by the echo text:
'Hello, World!'
<Echo Text>

So i am mystified as to what is going on. I have simply typed the text into a project in NetBeans and executed.

Revised code below:

7 years ago
I ran with all the shown imports at top and as currently is, with only one not commented out.

Regards,

Quentin
7 years ago
Hi,

Thanks for the welcome.

Here is the code:

7 years ago
Hi,

I am new to Java.

I am running Netbeans IDE 8.2 with Java Platform Standard Edition 8.

I am completing the 'Hello World' first program challenge detailed here: CodeChallenge
Challenge Day 0: Hello, World.

I don't want to issue a spoiler, in case anyone else is doing this, but i have added to the class the line of required code that prints the contents of the variable 'inputString' to stdout.
I have submitted the answer via the online tool which tests the code and the code is correct.

However, on my machine (Windows 7 X64 with set up as above), the code builds successfully but when i run it, it just keeps running and print nothing out.
I can see the task running bar at the bottom turn from green to blue but then it just keeps running and the progress bar doesn't progress.

I have searched the web and followed instructions such as:

uncheck "Compile on save" setting in the project properties (Build -> Compiling).

I have checked my steps against the following:
https://docs.oracle.com/javase/tutorial/getStarted/cupojava/netbeans.html

I am wondering if this is a configuration problem as the code itself appears to be correct.

Any advice greatly appreciated,

Quentin
7 years ago