블로그
- 45번째 퍼즐 - 피곤한 일 public class Q45_Exhausting_Workout { public static void main(String[] args) { workhard(); System.out.println 구문을 보면 무엇을 출력할지 쉽게 예측할 수 있다 workHard() 메소드는 스스로 StackOverflowError2 를 발생시키기 전까지 재귀 호출을 계속 한다 그러나 try-catch
- 40번째 퍼즐 - 주저하는 생성자 public class Q40_The_Reluctant_Constructor { private Q40_The_Reluctant_Constructor internalInstance = ; } catch (Exception e) { System.out.println("I told you so"); } }}Colo.......
- 42번째 퍼즐 - 어이없다 public class Q42_Thrown_for_a_Loop { public static void main(String[] args) { int[][] tests = {{6, 5, = 0; try { int i = 0; while (true) { if (thirdElementIsThree(tests[i++])) { successCount++; } } } catch
- 38번째 퍼즐 - 초대받지 않은 손님 문제는 이 메소드가 정적 필드를 초기화할 때 사용된다는 것으로, 자바는 정적 필드를 초기화할 때 예외가 발생하는 것을 허용하지 않는다 따라서 필드 초기화 부분은 별도로 try-catch public class Q38_The_Unwelcome_Guest { public static final long GUEST_USER_ID = -1; private static final
- [KOSTA 87기]2014년 10월 6일 월요일(10일차) 학습내용 정리 및 지난 수업내용 정리 컴파일 오류 (class 생성되지 않는 것) * 2. / 배열의 index 제어하는 코드 * 이점: 문제가 발생해도 일단 프로그램을 안정적으로 실행 * 객체지향언어에서 예외처리를 할수 있도로 아래 블럭제공 * * try{ * * }catch
- Java - File Hash 값 추출 java.io.RandomAccessFile;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException; public class sb.append(Integer.toString((byteData[i]&0xff) + 0x100, 16).substring(1)); } SHA = sb.toString(); }catch
- [영진전문대 컴퓨터정보계열] 자바 데이터베이스 레코드 추가 .*; import java.util.Scanner; public class helloworld { public static Connection makeConnection() { String 성공"); con = DriverManager.getConnection(url, id, password); System.out.println("데이터베이스 연결 성공"); } catch
- [영진전문대컴퓨터정보계열프로그래밍전공] 11월 25일 수업내용 .*; import java.util.Scanner; public class SQLSelectTest { public static Connection makeConnection() 적재 성공"); con = DriverManager.getConnection(ur1, id, password); System.out.println("데이터베이스 연결 성공"); }catch
- [영진전문대 컴퓨터정보계열 프로그래밍전공] 11월 21일 수업내용 레코드 검색 public class sdfg { public static void main(String[] args) { // TODO Auto-generated method stub -- import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class
- [영진전문대학 컴퓨터정보계열] .*; class Buffer{ private int data; private boolean empty = true; public synchronized int get(){ while (empty){ try{ wait(); }catch(InterruptedException e){} } empty = true; notifyAll(); return data++; }