Here I am Explaining how many types are available to print hello world or any character in java.
Kisi bhi Programming language ya markup language me execute krne se phle we need to write a boiler plate of that language
Jaise ham java ki bat karen to yaha boiler plate hota hai ๐ -
package HelloWorld;
public class LearningJava {
public static void main(String[] args) {
iske upr jo kuch v likhenge wo print nhi hoga .
Now let me print Hello World
- System.out.print("Hello World");
What is this ? ------- is syntax se Hello World print ho rha lekin dhyan rhe agr ham 2 times hello world likhenge to wo ek line me hi print hoga
Now, jaisa ki maine bataya is syntax se Single line me hi print hoga wo you can seee Hello world hello world 2 single line me print ho rha .
- System.out.println("Hello World");
Is syntax se jo v print hoga uske bad ek next line tak ki space aayegi and you can print another value on another line
⬆๐ you can see on this Snap I'm trying to print Hello World and Hello World 2 by using this syntax and output is coming on 2 lines
\n
System.out.print("Hello World\n");
System.out.print("Hello World 2");
Comments
Post a Comment