0
0
Javaprogramming~10 mins

Output using System.out.print in Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print "Hello" without a newline.

Java
System.out.[1]("Hello");
Drag options to blanks, or click blank then click option'
Aprintf
Bprintln
Cprint
Dwrite
Attempts:
3 left
💡 Hint
Common Mistakes
Using println instead of print, which adds a newline.
Using write which requires different parameters.
2fill in blank
medium

Complete the code to print the number 123 without a newline.

Java
System.out.[1](123);
Drag options to blanks, or click blank then click option'
Aprint
Bprintln
Cprintf
Dwrite
Attempts:
3 left
💡 Hint
Common Mistakes
Using println which adds a newline.
Using printf without format string.
3fill in blank
hard

Fix the error in the code to print "Java" without a newline.

Java
System.out.[1]("Java");
Drag options to blanks, or click blank then click option'
Aprintln
Bwrite
Cprintline
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent method printline.
Confusing println with print.
4fill in blank
hard

Fill both blanks to print the sum of 5 and 3 without a newline.

Java
System.out.[1](5 [2] 3);
Drag options to blanks, or click blank then click option'
Aprint
B+
C-
Dprintln
Attempts:
3 left
💡 Hint
Common Mistakes
Using println which adds a newline.
Using subtraction instead of addition.
5fill in blank
hard

Fill both blanks to print the uppercase word "HELLO" without a newline.

Java
System.out.[1]("hello".[2]());
Drag options to blanks, or click blank then click option'
Aprintln
BtoUpperCase
Cprint
DtoLowerCase
Attempts:
3 left
💡 Hint
Common Mistakes
Using println which adds a newline.
Using toLowerCase instead of toUpperCase.