/** Eight basic data Types boolean byte short int long char float double* / Public class test1{ publicstaticvoid main (string[] args) { long g = 1000L; float f = 3.14F; double d = 10.12345d; }}
Import Java.util.Scanner; Public class Main { publicstaticvoid main (string[] args) { new Scanner (system.in); int a = input.nextint (); int b = input.nextint (); System.out.println ("a+b =" + (A +B));} }
ImportJava.util.Random;ImportJava.util.Scanner; Public classMain { Public Static voidMain (string[] args) {/*** Array of three ways: * int x[];//DECLARE First * 2.int[] x = new INT[3]; * 3.int[] x = new int[]{3,4,5}; * 4.int[] x = {1,2,3,4}; * Find array Length: X.length*/Random R=NewRandom (); //returns a pseudo-random number, which is an int value that is evenly distributed between 0 (inclusive) and the specified value (not included) from this random number generator sequence. intx = R.nextint (10); SYSTEM.OUT.PRINTLN (x); }}
Java notes 1__ Basic data type/input/output/random number/array