class B {}class A {}--------------------------class C {}interface I {}-----------------------class D {}class E {}参考文献: Java Quick Syntax Reference by ...
分类:
编程语言 时间:
2014-08-09 04:52:17
阅读次数:
253
// Superclass (parent class)class Fruit{ public String flavor;}// Subclass (child class)class Apple extends Fruit { public String variety;}//downcasti...
分类:
编程语言 时间:
2014-08-09 04:51:47
阅读次数:
294
在 java 语言中, 用来处理字符串的的类常用的有 3 个: String、StringBuffer、StringBuilder。...
分类:
编程语言 时间:
2014-08-09 02:38:26
阅读次数:
445
if (x 1) System.out.print(x + " > 1");else System.out.print(x + " == 1");Switchswitch (y){ case 0: System.out.print(y + " is 0"); break; case 1: Syste...
分类:
编程语言 时间:
2014-08-09 02:35:12
阅读次数:
192
算术运算符 float x = 3+2; // 5 // addition 加x = 3-2; // 1 // subtraction 减x = 3*2; // 6 // multiplication 乘x = 3/2; // 1 // division 除x = 3%2; // 1 // modu...
分类:
编程语言 时间:
2014-08-09 02:34:56
阅读次数:
270
数组声明,分配, 赋值 int y[] = new int[3];y[0] = 1;y[1] = 2;y[2] = 3;int[] x = new int[] {1,2,3};int[] x = {1,2,3};二维数组String[][] x = {{"00","01"},{"10","11"}}...
分类:
编程语言 时间:
2014-08-09 02:34:46
阅读次数:
247
While 和 Do-While //whileint i = 0;while (i < 10) { System.out.print(i++);}//do - while int i = 0;do { System.out.print(i++); } while ( i < 10 );For 和 ...
分类:
编程语言 时间:
2014-08-09 02:34:36
阅读次数:
281
组合吃烤串的各种方法 String a = "Hello";String b = new String(" World");//在循环里面的话要小心用String c = a+b; // Hello World a += b; // Hello WorldString x = "Hello " + ...
分类:
编程语言 时间:
2014-08-09 02:33:46
阅读次数:
241
public class MyApp { public static void main(String[] args) { System.out.print("Hello World"); }}
分类:
编程语言 时间:
2014-08-09 02:32:17
阅读次数:
353
数据类型 类型 bits/byte 范围 默认值 byte 8/1 -128 +127 0 short 16/2 -32,768+32,767 0 int 32/4 -2,147,483,648 = -231+2,147,483,647 = 231-1 0 long 64/8 -9,223,372,...
分类:
编程语言 时间:
2014-08-09 02:32:07
阅读次数:
243