Here's a riddle: "Written once, it runs everywhere". Answer: A Java program. That's the right answer, because Java is logical and properly structured. Let's rephrase this slogan for students: "learn once, use anywhere!" Here's a little task on this topic: write a program that displays a useful phrase 10 times on the screen.
CodeGym. Learn once - use anywhere
- 1
Locked
Comments (31)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #10764856 Java Developer at BDL Holding
2 August 2021, 18:15
i did all correctly and issue come during verification?
What's the issue there
0
RAYX2445
1 July 2021, 04:43
How to use loop function...?
0
Barbara Fu
16 September 2020, 06:14
I copied the println bit ten times because I have no idea what loop is. Seriously, brand new at this. Is there a lesson later on that tells me how to tell it "print this ten times" rather than "print this; print this; print this; print this; print this; print this; print this; print this; print this; print this;"?
0
Thomas
16 September 2021, 00:17
Yes. It's a linear progression course ) ... could be a loop thru / could be object access
0
kenneth payne
12 September 2020, 19:34
I kept getting the typo error because I declared String phrase = "CodeGym. Learn once - use anywhere". Are we not allowed to declare variables of our own wording? I did not know the compiler required the use of the variable, String message.
0
Roman
14 September 2020, 04:23
Your mistake was in something else, the solution using the variable phrase passes the test.
0
kenneth payne
14 September 2020, 23:13
after today's practice where I missed the period at the end of my statement, solidifies your reply, thank you for the input!
0
Kittenthecool1
30 June 2021, 18:05
Did u add ; at the end?
0
Rahul
28 March 2020, 00:42
System.out.println("CodeGym. Learn once - use anywhere")
+1
Tomas
14 March 2020, 08:35
"learn once, use anywhere!" ???
+1
Deborah Wenrich
16 September 2019, 02:21
Lol, took a long time to get, but I got it.
+2
OMAR BADIAL
21 June 2019, 19:32
I used loo[p but the condition failed
0
Alex
3 July 2019, 15:53
Re-check your code to see if your loop statement is working. Does it work on another IDE like Intellij? Also make sure your loop is printing the line 10 times, no more, no less.
+1
Recle
15 June 2019, 16:27
I use loop, and I printed out the message directly,
using System.out.println("CodeGym use anywhere");
and I failed the last test 'The displayed text must match the task conditions.'
Why? there was no conditions stated that I have to insert the message into a string variable, which turns out to be the only thing my code was lacking when I click 'hint'.
0
Alex
3 July 2019, 15:51
I used loop and it worked fine. The message is supposed to be "CodeGym. Learn once - use anywhere" Try replacing your argument in System.out.println() with that.
+4
Ankur Sharma
23 May 2019, 17:14
it shows typo error whats that
+1