teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

3

編集

2015/10/24 08:23

投稿

退会済みユーザー
answer CHANGED
@@ -5,7 +5,7 @@
5
5
  じゃなくて
6
6
 
7
7
  ```java
8
- System.out.println(e.getStackTrace());
8
+ e.printStackTrace();
9
9
  ```
10
10
 
11
11
  でデバッグすべきです。

2

追記

2015/10/24 08:22

投稿

退会済みユーザー
answer CHANGED
@@ -12,4 +12,32 @@
12
12
 
13
13
  ---
14
14
 
15
- ちなみに、こちらの環境で提示されている現象は発生しません。Nzcさんと同じ結果です。
15
+ ちなみに、こちらの環境で提示されている現象は発生しません。Nzcさんと同じ結果です。
16
+
17
+ ---
18
+
19
+ ```java
20
+
21
+ public static void main(String[] args) {
22
+ try {
23
+ String strModule_info_data1 = "<山田>";
24
+
25
+ System.out.println("strModule_info_data1=" + strModule_info_data1);
26
+ System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
27
+
28
+ if (strModule_info_data1.substring(0, 1).equals("<") == true) {
29
+ System.out.println("きた2");
30
+ }
31
+ } catch (Exception e) {
32
+ System.out.println("e.getMessage()=" + e.getMessage());
33
+ }
34
+ }
35
+ ```
36
+
37
+ > きた2は、表示されません。★の行で例外で飛んでしまうので。
38
+
39
+ ```java
40
+ if (strModule_info_data1.substring(0, 1).equals("<") == true) {
41
+ ```
42
+
43
+ でないと、`System.out.println("きた2");` になるわけないのに、何がわからないというのでしょう?

1

tuiki

2015/10/24 07:42

投稿

退会済みユーザー
answer CHANGED
File without changes