Variables in languages

vulcanwm

Medea

Posted on February 26, 2022

Variables in languages

There's been many posts about how to say Hello World in different programming languages, but is there many about variables?
Well this post will tell you about how to declare variables (specifically a string) in different programming languages.


  • Python
variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • JavaScript
var variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • Java
String variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • C++
string variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • PHP
$variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • C#
string variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • R
variable <- "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • Rust
let mut variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • Swift
var variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode
  • ruby
variable = "Hello World!"
Enter fullscreen mode Exit fullscreen mode

That's it for now!
I hope you learnt something new and make sure to view all of my posts (and maybe follow).

💖 💪 🙅 🚩
vulcanwm
Medea

Posted on February 26, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Variables in languages
beginners Variables in languages

February 26, 2022