摘要:
import java.util.Date; public class DateDemo { public static void main(String args[]) { // 初始化 Date 对象 Date date = new Date(); // 使用 toString() 函数显示日期时间 Sys... 阅读全文
摘要:
public class Test{ public static void main(String args[]){ StringBuffer sBuffer = new StringBuffer("菜鸟教程官网:"); sBuffer.append("www"); sBuffer.append(".runoob"); sBuffer.append(".com... 阅读全文
摘要:
int a = 5000; float b = 13.65f; byte c = 0x4a; public class Test{ public static void main(String args[]){ Integer x = 5; x = x + 10; System.out.println(x); } } public ... 阅读全文
摘要:
public class Test { public static void main(String args[]){ //char grade = args[0].charAt(0); char grade = 'C'; switch(grade) { case 'A' : System.out... 阅读全文
摘要:
public class Test { public static void main(String args[]){ int x = 10; if( x < 20 ){ System.out.print("这是 if 语句"); } } } if(布尔表达式){ //如果布尔表达式的值为true }else{ ... 阅读全文
摘要:
public class Test { public static void main(String args[]) { int x = 10; while( x < 20 ) { System.out.print("value of x : " + x ); x++; System.out.print("\n"... 阅读全文
摘要:
public class Test { public static void main(String[] args) { int a = 10; int b = 20; int c = 25; int d = 25; System.out.println("a + b = " + (a + b) ); System.out.pr... 阅读全文
摘要:
public class Variable{ static int allClicks=0; // 类变量 String str="hello world"; // 实例变量 public void method(){ int i =0; // 局部变量 } } public class Test{ publi... 阅读全文