Nobody is gonna do that for you. Seriously?
However, here are a few things I have noted.
hello world in java
interface Printer
{
void print ( Message message );
}
class Message
{
private String message;
public Message ( String message )
{
this.message = message;
}
public void print ( Printer printer )
{
printer.print ( this );
}
public String toString()
{
return message;
}
}
abstract class AbstractPrinterFactory
{
public static AbstractPrinterFactory getFactory()
{
return new SystemOutPrinterFactory();
}
public abstract Printer getPrinter();
}
class SystemOutPrinterFactory extends AbstractPrinterFactory
{
public Printer getPrinter()
{
return new SystemOutPrinter();
}
}
class SystemOutPrinter implements Printer
{
public void print ( Message message )
{
System.out.println ( message );
}
}
class HelloWorld
{
public static void main ( String[] args )
{
Message message = new Message ( "Hello, World!" );
AbstractPrinterFactory factory = AbstractPrinterFactory.getFactory();
Printer printer = factory.getPrinter();
message.print ( printer );
}
} [1]hello world in c++ (note the difference in file size)
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
return 0; // it's very important, because you win, when ALL is Nothing ; }
}
Java is perfect, extremely fast, has no bugs! The fact that it *just works* on ANY operating system makes it superior to c++.
C++ also tends to be slower than java (scientifically proven) as monkeys tend to write code in c++ as opposed to humans writing code in java.
[1] An optimized version of java's hello world by James Gosling
public class HelloWorld
{
public class Program
{
public class start implements Program
{
public class init excludes mouse
{
public class HelloWorld implements init
{
public int main()
{
System.Java.Out.Output.Console.Write.Line.Text.White.BlackBackground.Last.Lineofcode.this.time.will.really.finish("Hello, world!");
}
}
}
}
}
}