摘要:
一、比较运算 1、比较运算符的结果都是boolean型,也就是要么是true,要么是false。2、比较运算符“==”不能误写成“=” 。 示例: public class Test { public static void main(String[] args) { System.out.prin 阅读全文
摘要:
一、可以连续赋值 public class datatype { public static void main(String[] args) { int m = 1; int n = 1; int l = 1; m = n =l=8; System.out.println(m+n+l); } } 阅读全文
摘要:
一、java 2个整数相除后会舍弃小数位,如下: public class datatype { public static void main(String[] args) { String c = 3l + ""; //3后面待l,表示long System.out.println(c); in 阅读全文
摘要:
一、初始变量 初始变量就是对变量进行第一次赋值,运行代码以最终的赋值结果进行输出。 public class datatype { public static void main(String[] args) { int a =1; // 声明初始变量 a =2; System.out.printl 阅读全文
摘要:
以下是java源码: public class test{ public static void main(String[] args){ System.out.println("test"); byte a=1; //这里结束需要分号; 以下类推 System.out.println(a); sh 阅读全文
摘要:
public class iloveyouright{ public static void main(String[] args){ System.out.println("\t*\t\t\t*"); System.out.println("*\t\ti love you\t\t*"); Syst 阅读全文
摘要:
public class hello_world{ public static void main(String[] args){ System.out.println("Hello world!"); } } class hello_world1{ public static void main( 阅读全文