Java复习重点!!.docVIP

  • 4
  • 0
  • 约4.07千字
  • 约 6页
  • 2018-04-18 发布于河南
  • 举报
Java复习重点!!

1、写结果 class StringTest1 { public static void main(String[] args) { String s1=hello; String s2=new String(hello); if(s1.equals(s2)){ System.out.println(相等); }else{ System.out.println(不相等); } } } 或者 public class IfTest{ public static void main(String args[]){ int x=3; int y=1; if(x=y) System.out.println(Not equal); else System.out.println(Equal); } } 2、写结果 public class TestArray { public static void main(String args[ ]){ int i , j ; int a[ ] = { 5,9,6,8,7}; for ( i = 0 ; i a.length-1; i ++ ) { int k = i;

文档评论(0)

1亿VIP精品文档

相关文档