“Hello, World!” in Different Languages


Below shows how the different programming languages print the message “Hello, World!.”
Java
Java, a versatile and widely-used programming language, starts with the traditional public class HelloWorld.

1public class HelloWorld {
2  public static void main( String[ ] args ) {
3    System.out.println( "Hello, World!" );
4  }
5}

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

1print("Hello, World!")

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

1#include <iostream>
2using namespace std;
3 
4int main( ) {
5  cout << "Hello, World!" << endl;
6  return 0;
7}

JavaScript
It is the language of the web, opts for a “log” to the console to announce its presence.

1console.log( "Hello, World!" );

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

1using System;
2 
3class Program {
4  static void Main( ) {
5    Console.WriteLine( "Hello, World!" );
6  }
7}

SQL
SQL, the language of databases, deviates from the norm by retrieving a message instead of directly printing it. Known for its simplicity and readability, keeps it short and sweet with just a single line to greet the world.

1SELECT 'Hello, World!' AS greeting;

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

1#include <stdio.h>
2 
3int main( ) {
4  printf( "Hello, World!\n" );
5  return 0;
6}

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

1<?php
2echo "Hello, World!";
3?>

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

1package main
2 
3import "fmt"
4 
5func main( ) {
6  fmt.Println( "Hello, World!" )
7}

Swift
Swift, Apple’s language for iOS development, imports itself and delivers a swift “print” statement.

1import Swift
2 
3print( "Hello, World!" )

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

1fun main( ) {
2  println("Hello, World!")
3}

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

1puts "Hello, World!"

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

1console.log( "Hello, World!" )

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

1object HelloWorld {
2  def main( args: Array[String] ): Unit = {
3    println( "Hello, World!" )
4  }
5}

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

1cat( "Hello, World!\n" )

Review: Programming Languages
    Which programming language is used to develop Android apps specifically?

      Go
      Kotlin
      Ruby
      Swift
Result: