質問編集履歴

9

e.printStackTrace()

2015/10/24 09:31

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -71,3 +71,9 @@
71
71
  System.out.println("きた3");
72
72
 
73
73
  }
74
+
75
+
76
+
77
+ ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
78
+
79
+ ![e.printStackTrace()を記述したときのeclipsの吹き出し](708d9fb44f89c68606819e851eb4bb3d.jpeg)

8

@b45130

2015/10/24 09:31

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  e.getMessage()=null
48
48
 
49
- [Ljava.lang.StackTraceElement;@b049a
49
+ [Ljava.lang.StackTraceElement;@b45130
50
50
 
51
51
 
52
52
 

7

[Ljava.lang.StackTraceElement;@b049a を追記

2015/10/24 07:50

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -28,6 +28,8 @@
28
28
 
29
29
  System.out.println("e.getMessage()=" + e.getMessage());
30
30
 
31
+ System.out.println("e.getStackTrace()=" + e.getStackTrace());
32
+
31
33
  }
32
34
 
33
35
 
@@ -43,6 +45,8 @@
43
45
  きた1=<
44
46
 
45
47
  e.getMessage()=null
48
+
49
+ [Ljava.lang.StackTraceElement;@b049a
46
50
 
47
51
 
48
52
 

6

PSを追加

2015/10/24 07:48

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,23 @@
47
47
 
48
48
 
49
49
  きた2は、表示されません。★の行で例外で飛んでしまうので。
50
+
51
+
52
+
53
+
54
+
55
+ ------------------------------------------------------------------------
56
+
57
+ PS.
58
+
59
+
60
+
61
+ ※上記へ、下記を追加したところ、
62
+
63
+ String str1moji = strModule_info_data1.substring(0, 1);
64
+
65
+ if (str1moji.equals("/") == true) { ← ★ここで例外になります
66
+
67
+ System.out.println("きた3");
68
+
69
+ }

5

語気

2015/10/24 07:35

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  ちなみに、
36
36
 
37
- eclipsのコンソースには、下記が表示されます。
37
+ eclipsのコンソースには、下記が表示されます。
38
38
 
39
39
 
40
40
 

4

追記

2015/10/24 07:28

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,11 @@
10
10
 
11
11
 
12
12
 
13
+ System.out.println("strModule_info_data1=" + strModule_info_data1);
14
+
13
15
  System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
16
+
17
+
14
18
 
15
19
  if (strModule_info_data1.substring(0, 1).equals("/") == true) { ← ★ここで例外
16
20
 
@@ -30,10 +34,16 @@
30
34
 
31
35
  ちなみに、
32
36
 
37
+ とeclipsのコンソースには、下記が表示されます。
38
+
39
+
40
+
41
+ strModule_info_data1=<山田>
42
+
33
43
  きた1=<
34
44
 
35
45
  e.getMessage()=null
36
46
 
37
- とeclipsのコンソースには、表示されます。
47
+
38
48
 
39
49
  きた2は、表示されません。★の行で例外で飛んでしまうので。

3

結果を追記

2015/10/24 07:27

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -4,24 +4,36 @@
4
4
 
5
5
 
6
6
 
7
+ try {
7
8
 
8
-
9
- String strModule_info_data1 = "<山田>";
9
+ String strModule_info_data1 = "<山田>";
10
10
 
11
11
 
12
12
 
13
- System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
13
+ System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
14
14
 
15
15
  if (strModule_info_data1.substring(0, 1).equals("/") == true) { ← ★ここで例外
16
16
 
17
- System.out.println("きた2");
17
+ System.out.println("きた2");
18
18
 
19
- }
19
+ }
20
+
21
+ }
22
+
23
+ catch (Exception e) {
24
+
25
+ System.out.println("e.getMessage()=" + e.getMessage());
26
+
27
+ }
20
28
 
21
29
 
22
30
 
31
+ ちなみに、
23
32
 
33
+ きた1=<
24
34
 
35
+ e.getMessage()=null
36
+
25
- ちなみに、きた1=< とeclipsのコンソースには、表示されます。
37
+ とeclipsのコンソースには、表示されます。
26
38
 
27
39
  きた2は、表示されません。★の行で例外で飛んでしまうので。

2

誤字

2015/10/24 07:23

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -22,6 +22,6 @@
22
22
 
23
23
 
24
24
 
25
- ちなみに、きた1=< とeclipsのソースには、表示されます。
25
+ ちなみに、きた1=< とeclipsのコンソースには、表示されます。
26
26
 
27
27
  きた2は、表示されません。★の行で例外で飛んでしまうので。

1

補足追記

2015/10/24 07:10

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,11 @@
17
17
  System.out.println("きた2");
18
18
 
19
19
  }
20
+
21
+
22
+
23
+
24
+
25
+ ちなみに、きた1=< とeclipsの今ソースには、表示されます。
26
+
27
+ きた2は、表示されません。★の行で例外で飛んでしまうので。