Hi,
I have below code but when I check for output even though I intentionally made space before Ellie in first row it doesnt show space. Why is that?
public class Solution {
public static void main(String[] args) {
System.out.println(" Ellie is very smart");
System.out.println("Ellie is very smart");
System.out.println("Ellie is very smart");
System.out.println("Ellie is very smart");
System.out.println("Ellie is very smart");
}
}
Output shows:
Ellie is very smart
Ellie is very smart
Ellie is very smart
Ellie is very smart
Ellie is very smart
But should be below shouldnt it?
Ellie is very smart
Ellie is very smart
Ellie is very smart
Ellie is very smart
Ellie is very smart
Why output doesnt show space?
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
William Wallace
13 October 2022, 11:11
I was using CodeGym app on my Android phone. Is there any other way when making tasks on phone?
0
Guadalupe Gagnon
12 October 2022, 19:29
Which compiler are you using? IntelliJ has the output that you expect. It may be that the compiler you are using trims leading white space.
0