Java Cross-platform
public class Javatest{public static void Main (string[] args) {System.out.println ("Java Test for Windows/linux");}}
Under the Windows,linux platform,
Use Javac Javatest.java; The Java javatest command was tested and passed smoothly. The javatest.class generated in the middle of the compilation can be interpreted and executed in different JVM virtual machines.
Dialog swing is a development kit for developing the Java application user interface.
Import javax.swing.*;p ublic class javadialog{public static void Main (string[] args) {Joptionpane.showmessagedialog ( NULL, "Hello Javadialog");}}
Java Javadialog Run:
Binary Data printing
public class binarystring{static string bstring (int num) {string result = ""; StringBuffer sb = new StringBuffer (""), int zerosnumber = Integer.numberofleadingzeros (num), while (zerosnumber--! = 0) { Sb.append ("0");} result = Sb.tostring () +integer.tobinarystring (num); return result;} public static void Main (string[] args) {int x = 10; System.out.println ("x=" +x+ "(" +bstring (x) + ")")//f:\java-tmp>java binarystring//x=10 ( 00000000000000000000000000001010)}}
Java Cross-Platform, dialog box, binary data printing