How do you add spaces in java?



How do you add spaces in java?..

Answer / Vivek Kumar Singh

You can add a space character in Java by using the ' ' symbol. To print multiple spaces, you can use the space character multiple times: System.out.print(" "); or you can use the String format method: System.out.printf("%10s", ""); to add a specific number of spaces.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can sleep() method causes another thread to sleep?

1 Answers  


Can static methods be overridden?

5 Answers   Bravura Solutions,


What is difference between static variable and global variable?

1 Answers  


what is platform independence in java?

5 Answers   CSC, HSBC,


in a console we r giving java <class name> if r pressing enter where it'll goes

2 Answers   CSC,


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

1 Answers  


What is the use of arrays tostring () in java?

1 Answers  


if a java file without any source code is valid java file?

3 Answers   SparkTG,


What is a nullable field?

1 Answers  


why applet doesn't have main? isn't possible a program with out main?

9 Answers   TCS,


What is prime number in java?

1 Answers  


What is int lol?

1 Answers  


Categories