Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for 'Hello, World!' in 15 different languages 💥
Tilak Thapa
Tilak Thapa

Posted on

     

'Hello, World!' in 15 different languages 💥

Introduction:

Programming is often seen as a serious and daunting endeavor. However, it doesn't have to be! Today, we're going to take a light-hearted journey into the world of coding by writing the quintessential "Hello, World!" program in not one, not two, but 15 different programming languages. And trust us, it's going to be a rollercoaster ride through the quirky and the downright professional. So, fasten your seatbelts, and let's dive in!

1.Java

publicclassHelloWorld{publicstaticvoidmain(String[]args){System.out.println("Hello, World!");}}
Enter fullscreen modeExit fullscreen mode

Java, a versatile and widely-used programming language, starts with the traditional public class HelloWorld.

2.Python

print("Hello, World!")
Enter fullscreen modeExit fullscreen mode

Python, known for its simplicity and readability, keeps it short and sweet with just a single line to greet the world.

3.C++

#include<iostream>usingnamespacestd;intmain(){cout<<"Hello, World!"<<endl;return0;}
Enter fullscreen modeExit fullscreen mode

C++ takes a more structured approach, with headers and namespaces, but still delivers the iconic message with style.

4.JavaScript

console.log("Hello, World!");
Enter fullscreen modeExit fullscreen mode

JavaScript, the language of the web, opts for a "log" to the console to announce its presence.

5.C#

usingSystem;classProgram{staticvoidMain(){Console.WriteLine("Hello, World!");}}
Enter fullscreen modeExit fullscreen mode

C#, a language for Windows applications, uses a class-based structure to showcase its greeting.

6.SQL

-- SQL doesn't usually say "Hello, World!" but let's break the moldSELECT'Hello, World!'ASgreeting;
Enter fullscreen modeExit fullscreen mode

SQL, the language of databases, deviates from the norm by retrieving a message instead of directly printing it.

7.C

#include<stdio.h>intmain(){printf("Hello, World!\n");return0;}
Enter fullscreen modeExit fullscreen mode

Good old C, the foundation of many languages, follows the "printf" tradition to send greetings.

8.PHP

<?phpecho"Hello, World!";?>
Enter fullscreen modeExit fullscreen mode

PHP, a web scripting language, wraps its message in PHP tags and employs "echo" to make its introduction.

9.Go

packagemainimport"fmt"funcmain(){fmt.Println("Hello, World!")}
Enter fullscreen modeExit fullscreen mode

Go, known for its efficiency, utilizes packages and "fmt" to extend a warm welcome.

10.Swift

importSwiftprint("Hello, World!")
Enter fullscreen modeExit fullscreen mode

Swift, Apple's language for iOS development, imports itself and delivers a swift "print" statement.

11.Kotlin

funmain(){println("Hello, World!")}
Enter fullscreen modeExit fullscreen mode

Kotlin, a modern language for Android, keeps it concise and clear with "fun" and "println."

12.Ruby

puts"Hello, World!"
Enter fullscreen modeExit fullscreen mode

Ruby, beloved for its readability, simply "puts" the message on the screen.

13.TypeScript

console.log("Hello, World!");
Enter fullscreen modeExit fullscreen mode

TypeScript, a typed superset of JavaScript, sticks to the familiar "console.log" for its greeting.

14.Scala

objectHelloWorld{defmain(args:Array[String]):Unit={println("Hello, World!")}}
Enter fullscreen modeExit fullscreen mode

Scala, known for its elegance, introduces an "object" and a "def" to send its warm regards.

15.R

cat("Hello, World!\n")
Enter fullscreen modeExit fullscreen mode

R, a language for statistical computing, uses "cat" to convey its message with a newline character.

Each of these programming languages may have its own quirks and purposes, but they all unite in the simple act of saying "Hello, World!" It's a testament to the diversity and creativity in the world of coding. So, whether you're a beginner or a seasoned developer, remember that coding can be both serious and fun. Happy coding! 🚀

Top comments(2)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
dshaw0004 profile image
Dipankar Shaw
426 Upgrade Required
  • Education
    B.Sc.
  • Work
    student
  • Joined

Nice

CollapseExpand
 
karim_abdallah profile image
Karim Abdallah
I am an Android Developer Using Kotlin Native, Jetpack Compose & Java, where I use my skills in PHP, SQL, Kotlin, Java, and C++
  • Email
  • Location
    Egypt
  • Education
    self learning
  • Pronouns
    Karim
  • Work
    Android Engineer
  • Joined

Kotlin is the best 🔥♥️

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

🙋‍♂️ Greetings! I'm Tilak Thapa(jrTilak), a passionate web developer with more than 1 years of experience. I specialize web development in React and Next.js. I'm also a huge fan of open-source.
  • Education
    IOE Purwanchal Campus
  • Work
    CS Student
  • Joined

More fromTilak Thapa

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp