锁定老帖子 主题:Java每日一题22
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (4)
|
|
---|---|
作者 | 正文 |
发表时间:2009-12-25
像你这么理解,不如用equals()方法呢?!
import java.util.Scanner; public class ScanerChar { private static final String str="qeirqndfadsrweqewrqewr"; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String ss = scanner.nextLine(); if(str.equals(ss)){ System.out.println("SUCCESS") ; }else{ System.out.println("FAIL"); } } } |
|
返回顶楼 | |
发表时间:2009-12-25
ping2010 写道 像你这么理解,不如用equals()方法呢?!
import java.util.Scanner; public class ScanerChar { private static final String str="qeirqndfadsrweqewrqewr"; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String ss = scanner.nextLine(); if(str.equals(ss)){ System.out.println("SUCCESS") ; }else{ System.out.println("FAIL"); } } } 像你这么理解,不如用equals()方法呢?! import java.util.Scanner; public class ScanerChar { private static final String str="qeirqndfadsrweqewrqewr"; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String ss = scanner.nextLine(); if(str.equals(ss)){ System.out.println("SUCCESS") ; }else{ System.out.println("FAIL"); } } } |
|
返回顶楼 | |