exception

    -2熱度

    1回答

    這個錯誤讓我的神經。 Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:862) at java.util.Scanner.next(Scanner.java:1485) at java.util.Scanner.

    -1熱度

    2回答

    我將字符串轉換爲Integer,所以當我收到任何字符時,拋出異常並且執行停止。我想跳過那個字符並打印所有剩下的數字,所以我一直在while循環中捕獲。但是現在,對於每一個異常,都會拋出一個錯誤,其餘的數字按照異常打印出來,但是一旦拋出異常,代碼必須發送郵件給團隊(我將把郵件部分放入catch中)。如果代碼在每次拋出異常時發送郵件都不好,所以我必須收集while循環內的所有異常並一次性發送有關所有異

    -2熱度

    2回答

    如何處理EmptyStackException這段代碼?在閱讀文件的一部分後,顯示我的堆棧是空的。我猜它與push()和pop()方法有關,但不完全確定。 Stack<Integer> stack = new Stack<Integer>(); int op1, op2, result = 0; String token; StringTokenizer tokeni

    2熱度

    1回答

    我有我自己的異常,由我的類BrowserException拋出。 這可能是因爲某些內部問題,即UnsupporderEncodingException。 現在我有兩個選擇: Throwable.addSuppressed(Throwable異常) Throwable.initCause(Throwable的原因) 在例外情況,就是suppressedException和事業之間的區別? 我什麼時候

    0熱度

    1回答

    我想從兩個文本框輸入輸入創建兩個整數的字符串添加在一起。我不斷收到,基本上只是說:「索引必須是該列表的範圍內」 這裏的錯誤是我的代碼 private char[] array1; private char[] array2; String input1 = tbUserInput1.Text; array1 = input1.ToCharArray(); int[]

    0熱度

    1回答

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text.RegularExpressions;

    1熱度

    1回答

    我已經實現了一些功能,允許處理應用程序服務器上的套接字連接。這裏是我的代碼摘錄: @Dependent public class SocketServerService { @Resource(name = "DefaultManagedThreadFactory") private ManagedThreadFactory threadFactory; pri

    0熱度

    1回答

    每次我嘗試選擇一個單元格是不可見的時候,我得到一個異常: let cell = collectionView.cellForItem(at: indexPath) as! CustomCell 這就是爲什麼我決定先滾動到它,所以它得到分享範圍,然後選擇它: collectionView.scrollToItem(at: indexPath, at: [], animated: true) l

    0熱度

    2回答

    我正在寫一個基於Quickfix/N的FIX引擎,它偵聽交易執行(ExecutionReport)並將它們保存到數據庫中。 如果接收到的消息中不存在該值,則從API請求字段值將引發FieldNotFoundException。舉例來說,如果帳戶不存在,調用executionReport.Account將拋出異常。 由於有些字段是可選的,我必須在獲取字段值之前明確檢查字段值的存在。 我有兩個可能性:

    4熱度

    1回答

    經過12年的間歇後回到C++開發。我使用JetBrains的CLion軟件,這非常棒,因爲它提供了關於我的班級設計中可能出現的問題的大量輸入。我在課堂上的構造函數throw statement中得到的警告之一是:Thrown exception type is not nothrow copy constructible。以下是生成此警告的代碼示例: #include <exception> #