1. [ VB ] Hello world
"Hello World" is our first program. This takes several lines - we don't need to worry about most of these.
test text
1. [ C++ ] Hello world
"Hello World" is our first program. This takes several lines - we don't need to worry about most of these.
iostream is part of the standard library that comes with
C++, iostream deals with input, output streams.
cout belongs to namespace std, it's full name is
std::cout
we can shorten this to cout by using the namespace.
The method
main is the one that
gets run.cout represents the standard
(console) output. The operator << takes an
output stream on the left
value to be output on the right.test text
1. [ C# ] Hello world
"Hello World" is our first program. This takes several lines - we don't need to worry about most of these.
This web site will save your text in a file call Hello.cs and compiled
into Hello.exe
When a class is executed the system looks for a method called
Main and
starts execution there. If a class does not have a main method then it
may compile fine - but it cannot be executed. Try it.
Console is the standard output - on a command prompt
it simply goes to
the screen. In this environment I stick it on a web page.
test text
1. [ Java ] Hello world
"Hello World" is our first program. This takes several lines - we don't need to worry about most of these.
This web site will save your text in a file call Hello.java and compiled
into Hello.class
The language insists that the class Hello is in a file called Hello.java if you change the name of the class then the compilation will fail. Try it.
The language insists that the class Hello is in a file called Hello.java if you change the name of the class then the compilation will fail. Try it.
When a class is executed the system looks for a method called main and
starts execution there. If a class does not have a main method then it
may compile fine - but it cannot be executed. Try it.
System.out is the standard output - on a command prompt it simply goes to
the screen. In this environment I stick it on a web page. Another place
to output is the standard error output System.err. However I simply
merge the two output streams together so you can't see the difference.
test text
1. [ Perl ] Hello world
"Hello World" is our first program. This takes several lines - we don't need to worry about most of these.
Strictly this is not part of the perl program - but it tells the
operating system what to do with the file. /usr/bin/perl is typically
where the perl executable is on a Linux system. It might be
c:/perl/bin/perl.exe on a Windows system.
This pragma makes perl check that variables have been declared,
you don't have to do this - but you should.
test text