David Douthitt wrote:
> [snip]
>
> You might say I enjoy FORTH - and you'd be understating things :)
What does a hello world in FORTH look like?
Maybe could you also post an example that asks
your full name then echos the first name and
last name on different lines?
Just curious.
Matt
btw, for Java, the two examples are easier to make
as a gui app, but the answer for a terminal would be:
-------------- begin Hello.java ------------
// A comment starts with slash slash
public class Hello
{
public static void main( String[] arg )
{
System.out.println( "Hello World." );
}
}
--------------- end Hello.java -------------
--------- begin Fullname.java --------------
import java.util.*; // these are like #includes
import java.io.*; // but the dots seperate dirs
public class Fullname
{
public static void main( String args[] ) throws Exception
{
BufferedReader keyb = new BufferedReader(
new InputStreamReader( System.in ) );
System.out.print( "Please enter your full name : " );
String s = keyb.readLine();
StringTokenizer tokens = new StringTokenizer( s );
System.out.println( "Thanks, you entered " + s + ".\nAnd " +
"split up thats..." );
while ( tokens.hasMoreTokens() )
{
System.out.println( tokens.nextToken() );
}
} // end of main
} // end of class Fullname
------------------ end of Fullname.java -----------------
Those would be compiled with:
javac *.java
which creates Hello.class and Fullname.class.
Those are the executables, and they are run with:
java Hello
java Fullname
Java is very case sensative, and classes start
with a capital letter.
_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel