Difference between revisions of "Calico Java"

From IPRE Wiki
Jump to: navigation, search
Line 40: Line 40:
 
JavaGraphics.main();
 
JavaGraphics.main();
 
</pre>
 
</pre>
 +
 +
== calico object ==
 +
 +
Java now support [[Calico: calico object]] and interaction with other languages. Can also work via [[ICalico]] via notebooks in a web browser.

Revision as of 19:43, 17 April 2014

Calico Java

To use, do the following:

  1. Start Calico
  2. From menu -> "Calico" -> "Languages" and check "Java"
  3. You can then:
    1. select menu -> Shell -> "Java", and type Java programs, and statements in the shell
    2. create a new Java program (menu -> File -> New)

You can enter into Calico whole Java programs, statements, and even partial statements. Note that you currently must press enter twice if the line does not end in a semi-colon.

java>>> int x = 1;
java>>> x
1

Examples

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}

HelloWorld.main(new String[0]);
import Graphics;

public class JavaGraphics {
    public static void main() {
	Graphics.WindowClass window = Graphics.Window("Testing", 400, 100);
    }
}

JavaGraphics.main();

calico object

Java now support Calico: calico object and interaction with other languages. Can also work via ICalico via notebooks in a web browser.