[Java]NullPointerException()のサンプル

2021年6月9日

書式
throw new NullPointerException()
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
static public void deleteUserGroup(Connection conn, String userid) throws SQLException {
if (conn == null || id == null) {
throw new NullPointerException();
}
//some code
}
static public void deleteUserGroup(Connection conn, String userid) throws SQLException { if (conn == null || id == null) { throw new NullPointerException(); } //some code }
static public void deleteUserGroup(Connection conn, String userid) throws SQLException {
   if (conn == null || id == null) {
         throw new NullPointerException();
   }
   //some code
   }

 

Java

Posted by arkgame