Java: 5 ways 💁🏻‍♂️ to print hello world in Java Language | Java Programming Practices

Опубликовано: 21 Март 2025
на канале: TechMoodly
118
3

Explained Java Programming Ways to Print “hello world” : Hello Guys, Now we are going to discuss that 5 ways to Print hello world or any statement in Java. We only know the 1 or two ways but In this article you will see all 5 way to print “Your Statement” in Java Programming.

Java: 5 ways 💁🏻‍♂️ to print hello world or any statement in Java Language | Java Programming Practices

🎯 Watch Next:
○ Java Program on Website : https://techmoodly.com/java-programs/...
○ Java Category on Web : https://techmoodly.com/category/java-...
○ Calculate sum of First n Numbers :    • Java Program to find sum of first n N...  
○ Java : https://www.java.com

🎯 Chapter of this Video:

01:03 - First Way: Using Print Statement in Main Method
02:55 - Second Way: Using Default Constructor
05:34 - Third Way: Using Parameterized Constructor
07:30 - Fourth Way: Using Member Function
10:10 - Fifth Way: Using Passing Argument

🎯 More Information on Video:
In This Coding Example, I have created the Class “WaysToPrintHello”, You can take any name. All have been Commented Here:
👩‍🏫 First Way: Using Print Statement in Main Method : ---

Java System.out.println() is used to print an argument that is passed to it. The statement can be broken into 3 parts which can be understood separately as:
System: It is a final class defined in the java.lang package.
out: This is an instance of PrintStream type, which is a public and static member field of the System class.
println(): As all instances of PrintStream class have a public method println(), hence we can invoke the same on out as well. This is an upgraded version of print(). It prints any argument passed to it and adds a new line to the output. We can assume that System.out represents the Standard Output Stream.

👩‍🏫 Second Way: Using #Default Constructor : --

In #Java, a #constructor is a block of codes similar to the method. It is called when an instance of the class is created. At the time of calling constructor, memory for the object is allocated in the memory. It is a special type of method which is used to initialize the object.
Every time an object is created using the new() keyword, at least one constructor is called.
It calls a default constructor if there is no constructor available in the class. In such case, Java compiler provides a default constructor by default.

👩‍🏫 Third Way: Using Parameterized Constructor

Parameterized Constructor – A constructor is called Parameterized Constructor when it accepts a specific number of parameters. To initialize data members of a class with distinct values.

👩‍🏫 Fourth Way: Using Member Function

The functions declared inside the class are known as member functions.
Member functions are methods or functions that are defined inside of objects. Generally used to manipulate data members and other object data.

👩‍🏫 Fifth Way: Using Passing Argument

Here we have defined Member Function display() and passing a string argument which is String Value in s.

🎯 I USE:
My Mic: https://amzn.to/3rnx6eV
My Laptop: https://amzn.to/3b93Wds
My KeyBoard and Mouse: https://amzn.to/3kCjjyp
[Screen Recording: shorturl.at/cgiow]

🎯 SOME OTHER TUTORIAL:
○ERP Tutorial: https://bit.ly/3beetnX
○MIS Tutorial: http://bit.ly/3sRLjB5
○Multimedia Tutorial: http://bit.ly/2PsUOYR
○BPO Tutorial: https://bit.ly/30a5vl9
○Computer Hardware Tutorial: https://bit.ly/387UzZO
○Project Management Tutorial:
○Java Programming Practice: http://bit.ly/2O18tpB
○Windows Tips and Tricks: http://bit.ly/3kGmQf9
○Android Tips and Tricks: http://bit.ly/3c1CkX0

Without You? We are nothing and No Where!
Share with us in the Comment Section Below : What did you learn in this Video?

🎯 About Techmoodly:

Techmoodly is a YouTube channel and Tech Blog where We can Learn and Share All Knowledge and Experiences related To Tech blogs .

We provide our Educational Opinion for :

Hardware Tutorial
Networking Tutorial
Codes Tutorial
Software Tutorials
Tips and Tricks
Research Based

🎯 Links to Follow:

○ Website: https://techmoodly.com
○ Twitter:   / techmoodly  
○ Facebook:   / techmoodly  
○ Instagram:   / techmoodly  
○ Email: [email protected] , [email protected]

🎯 Connect to Me :

Name : Ankit Sudegora(Worker of this Channel)
○ Facebook:   / ankitsudegora  
○ Instagram:   / ankitsudegora  
○ Email: [email protected], [email protected]

Don’t forget to subscribe to our channel and turn on your notifications!