This is an old revision of the document!
plan | with functions and variables |
<?php
echo "Hello World!";
?>
| <?php
$myString = "Hello World!";
function printMyString(){
global $myString;
echo $myString;
}
printMyString();
?>
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Hello World Example</title>
</head>
<body>
<h1>Hello World Example</h1>
<p>Hello World!</p>
</body>
</html>
plain | with functions and variables |
#include <stdio.h>
int main(){
printf("Hello World!\n");
return 0;
}
| #include <stdio.h>
const char * myString;
void printMyString(){
printf("%s\n",myString);
return;
}
int main(){
myString = "Hello World!";
printMyString();
return 0;
}
|
plain | with functions and variables |
public class HelloWorld{
public static void main(String args[]){
System.out.println("Hello World!");
}
}
| public class HelloWorldVar{
private String myString = "Hello World!";
private void printMyString(){
System.out.println(myString);
}
public static void main(String args[]){
HelloWorldVar hw = new HelloWorldVar();
hw.printMyString();
}
}
|