質問編集履歴
9
e.printStackTrace()
title
CHANGED
File without changes
|
body
CHANGED
@@ -34,4 +34,7 @@
|
|
34
34
|
String str1moji = strModule_info_data1.substring(0, 1);
|
35
35
|
if (str1moji.equals("/") == true) { ← ★ここで例外になります
|
36
36
|
System.out.println("きた3");
|
37
|
-
}
|
37
|
+
}
|
38
|
+
|
39
|
+
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
|
40
|
+

|
8
@b45130
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
strModule_info_data1=<山田>
|
23
23
|
きた1=<
|
24
24
|
e.getMessage()=null
|
25
|
-
[Ljava.lang.StackTraceElement;@
|
25
|
+
[Ljava.lang.StackTraceElement;@b45130
|
26
26
|
|
27
27
|
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
28
28
|
|
7
[Ljava.lang.StackTraceElement;@b049a を追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
}
|
14
14
|
catch (Exception e) {
|
15
15
|
System.out.println("e.getMessage()=" + e.getMessage());
|
16
|
+
System.out.println("e.getStackTrace()=" + e.getStackTrace());
|
16
17
|
}
|
17
18
|
|
18
19
|
ちなみに、
|
@@ -21,6 +22,7 @@
|
|
21
22
|
strModule_info_data1=<山田>
|
22
23
|
きた1=<
|
23
24
|
e.getMessage()=null
|
25
|
+
[Ljava.lang.StackTraceElement;@b049a
|
24
26
|
|
25
27
|
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
26
28
|
|
6
PSを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -22,4 +22,14 @@
|
|
22
22
|
きた1=<
|
23
23
|
e.getMessage()=null
|
24
24
|
|
25
|
-
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
25
|
+
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
26
|
+
|
27
|
+
|
28
|
+
------------------------------------------------------------------------
|
29
|
+
PS.
|
30
|
+
|
31
|
+
※上記へ、下記を追加したところ、
|
32
|
+
String str1moji = strModule_info_data1.substring(0, 1);
|
33
|
+
if (str1moji.equals("/") == true) { ← ★ここで例外になります
|
34
|
+
System.out.println("きた3");
|
35
|
+
}
|
5
語気
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
}
|
17
17
|
|
18
18
|
ちなみに、
|
19
|
-
|
19
|
+
eclipsのコンソースには、下記が表示されます。
|
20
20
|
|
21
21
|
strModule_info_data1=<山田>
|
22
22
|
きた1=<
|
4
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
try {
|
5
5
|
String strModule_info_data1 = "<山田>";
|
6
6
|
|
7
|
+
System.out.println("strModule_info_data1=" + strModule_info_data1);
|
7
8
|
System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
|
9
|
+
|
8
10
|
if (strModule_info_data1.substring(0, 1).equals("/") == true) { ← ★ここで例外
|
9
11
|
System.out.println("きた2");
|
10
12
|
}
|
@@ -14,7 +16,10 @@
|
|
14
16
|
}
|
15
17
|
|
16
18
|
ちなみに、
|
19
|
+
とeclipsのコンソースには、下記が表示されます。
|
20
|
+
|
21
|
+
strModule_info_data1=<山田>
|
17
22
|
きた1=<
|
18
23
|
e.getMessage()=null
|
19
|
-
|
24
|
+
|
20
25
|
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
3
結果を追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
JAVAで、以下の★の行で、例外が発生します。
|
2
2
|
原因はなにでしょうか?(例外のメッセージは、nullなので、原因がわかりません)。
|
3
3
|
|
4
|
+
try {
|
5
|
+
String strModule_info_data1 = "<山田>";
|
4
6
|
|
5
|
-
String strModule_info_data1 = "<山田>";
|
6
|
-
|
7
|
-
System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
|
7
|
+
System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
|
8
8
|
if (strModule_info_data1.substring(0, 1).equals("/") == true) { ← ★ここで例外
|
9
|
-
System.out.println("きた2");
|
9
|
+
System.out.println("きた2");
|
10
|
-
|
10
|
+
}
|
11
|
+
}
|
12
|
+
catch (Exception e) {
|
13
|
+
System.out.println("e.getMessage()=" + e.getMessage());
|
14
|
+
}
|
11
15
|
|
12
|
-
|
16
|
+
ちなみに、
|
17
|
+
きた1=<
|
18
|
+
e.getMessage()=null
|
13
|
-
|
19
|
+
とeclipsのコンソースには、表示されます。
|
14
20
|
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,5 +10,5 @@
|
|
10
10
|
}
|
11
11
|
|
12
12
|
|
13
|
-
ちなみに、きた1=< とeclipsの
|
13
|
+
ちなみに、きた1=< とeclipsのコンソースには、表示されます。
|
14
14
|
きた2は、表示されません。★の行で例外で飛んでしまうので。
|
1
補足追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,4 +7,8 @@
|
|
7
7
|
System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
|
8
8
|
if (strModule_info_data1.substring(0, 1).equals("/") == true) { ← ★ここで例外
|
9
9
|
System.out.println("きた2");
|
10
|
-
}
|
10
|
+
}
|
11
|
+
|
12
|
+
|
13
|
+
ちなみに、きた1=< とeclipsの今ソースには、表示されます。
|
14
|
+
きた2は、表示されません。★の行で例外で飛んでしまうので。
|