Java [Material]
[Startseite] / [Fächer] / [Informatik] / [Java]
Hohenstaufen-Gymnasium
Kaiserslautern
Autor: mk
Letzte Änderung: 03.12.2004 09:13:40   4442
Java

Programm 1 - das "Hallo Welt" - Programm

public class p1
{

  public static void main(String[] args)
  {
     System.out.println("Hallo Welt!");
  }
}

Programm 3 - eingeben und wieder ausgeben

aus Java ist auch eine Insel Openbook von Christian Ullenboom, Listing 12.11
  public class KonsolenHinUndHer
{
  public static void main( String args[] )
  {
    System.out.println( "\nGib mir eine Zeile Text: " );
    byte buffer[] = new byte[255];
    try
    {
      System.in.read( buffer, 0, 255 );
    }
    catch ( Exception e )
    {
      System.out.println( e );
    }
    System.out.println( "\nDu hast mir gegeben: ");
    System.out.println( new String(buffer) );
  }
}
Tutorial, Bradley Kjell, Central Connecticut State University,übersetzt 2003 von Heinrich Gailer
Material zu BlueJ