There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
I was expecting it “One…” to print on another line as well but I realized why it printed on “Three… Two…” instead. The reason for that was because “Three… Two…” was never given the command to print on two separate lines so whatever is printed after that will be included in the “Three… Two…” output as a complete line.
It looks like it is not working in that way. Even when I use println it is still remaining in the same line rather than moving to the next one. Ideally as per the theoretical concept when the print is used it will remain on the same line but when the println is used it should move to the next line.
Something that isn’t mentioned (that I could find), but is VERY important, is that commands in this language are case sensitive. As an example: system.out.print(“”) will result in a compiling error vs. System.out.print(“”) will not. Mentioning this prior to the exercises might result in fewer errors by students who currently have to make that realization for themselves.
I’m currently stuck on the part where it says System.out.print(“Two…”); It keeps asking me if I’ve used the correct format and I believe I did and now I’m stuck after reloading the page, looking at the hint and trying to look here
public class HideAndSeek {
public static void main(String args) {
System.out.println(“Let’s play hide and seek.”);
System.out.print(“Three”);
System.out.print(“Two”);
}
}
Keep getting an error, keeps asking me if I used the Print line function for some reason… why?
When you copy-paste code directly into the forums, some characters lose their formatting which makes it difficult to spot any potential issues. To preserve code formatting in forum posts, see: [How to] Format code in posts
Your strings should match the strings specified in the instructions EXACTLY including capitalization, spelling, spacing etc.
// You wrote:
System.out.print("Three");
System.out.print("Two");
// It should be:
System.out.print("Three...");
System.out.print("Two...");
public class HideAndSeek {
public static void main(String args) {
System.out.println(“Let’s play hide and seek.”);
System.out.print(“Three…”);
System.out.print(“Two…”);
System.out.println(“One…”);
System.out.println(“Ready or not,here I come!”);
}
}
I have just finished this exercise but am not allowed to move to the next stage. Why? Is there any problem with the code
this website its a waist of time i wrote manually like 20 times and doesnt work, i will never buy the paid version
System.out.print(“Three…”);
System.out.print(“Two…”);
There are two things that can offer clues as to why your solution is not being accepted. You can either
Upload a screenshot showing ALL your code and the error message/feedback which pops up at bottom (There is an upload button in the forum post editor).
OR
There is a “Copy to Clipboard” button at the bottom of the exercise. Click on it to copy your code. Don’t paste the code directly into the forums, because doing so messes with the formatting of characters etc. Instead, use the the </> button to paste your code (For more details, see: How do I format code in my posts?)
You seem to be missing a closing curly brace } on line 7. You do have a closing curly brace on line 6 for main. But, you also need a closing curly brace for the HideAndSeek class. You likely inadvertently deleted it while writing your print statements.
The instructions in Step 1 specify that System.out.print should be used for the first two print statements. In Step 2, it is specified that System.out.println should be used. So, you will need to do something like (the comments are just for illustrative purposes. You don’t need to include comments):
System.out.println("Let's play hide and seek.");
// Step 1
System.out.print("Three...");
System.out.print("Two...");
// Step 2
System.out.println("One...");
System.out.println("Ready or not, here I come!");