Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
public:computer:java [2021/12/17 18:39] – created alex | public:computer:java [2022/09/15 23:06] – alex | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Java ====== | ====== Java ====== | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * Local | ||
+ | * Zoned | ||
+ | * Offset | ||
+ | * Collections | ||
+ | * List; ArrayList, LinkedList | ||
+ | * Set; HashSet, LinkedHashSet | ||
+ | * Map; HashMap, LinkedHashMap | ||
+ | * | ||
+ | |||
+ | * 람다식 | ||
+ | |||
+ | (자료형 인수, ...) -> { ... 임의의 처리 ...} | ||
+ | |||
+ | ==== Database ==== | ||
+ | <sxh java> | ||
+ | import java.sql.*; | ||
+ | |||
+ | ... | ||
+ | ... | ||
+ | Connection conn = null; | ||
+ | | ||
+ | try | ||
+ | { | ||
+ | Class.forName(" | ||
+ | } | ||
+ | catch(ClassNotFoundException e) | ||
+ | { | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | | ||
+ | try | ||
+ | { | ||
+ | conn = DriverManager.getConnection(" | ||
+ | | ||
+ | Statement stmt = conn.createStatement(); | ||
+ | ResultSet rset = stmt.executeQuery(" | ||
+ | | ||
+ | while(rset.next()) | ||
+ | { | ||
+ | // do something | ||
+ | } | ||
+ | } | ||
+ | catch(SQLException e) | ||
+ | { | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | finally | ||
+ | { | ||
+ | if(conn != null) | ||
+ | { | ||
+ | try | ||
+ | { | ||
+ | conn.close(); | ||
+ | conn = null; | ||
+ | } | ||
+ | catch(SQLException e) | ||
+ | { | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | ... | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | * conn.setAutoCommit(true/ | ||
+ | * conn.commit(); | ||
+ | * conn.rollback() | ||
+ | * PreparedStatement stmt = conn.prepareStatement(" | ||
+ | * stmt.setString(1, | ||
+ | |||
+ | * DAO< | ||
+ | * DTO< | ||
+ | * JPA< | ||
+ | |||
+ | |||
+ | ==== File I/O ==== | ||
+ | * FileReader | ||
+ | * BufferedReader | ||
+ | * Scanner | ||
+ | * Files | ||
+ | |||
+ | * CSV, XML, LOGGER | ||
+ | |||
+ | |||
+ | ==== Tests ==== | ||
+ | |||
+ | * JUint | ||
+ | * @Test | ||
+ | * @Before | ||
+ | * @After | ||
+ | * @BeforeClass | ||
+ | * @AfterClass | ||
+ | * @Ignore | ||
+ | * import static org.junit.Assert.*; | ||
+ | * assertEquals() | ||
+ | * fail() | ||
+ | * assertThat() | ||
+ | * import static org.hamcrest.CoreMatchers.*; | ||
+ | * is() | ||
+ | * JMockit | ||
+ | * DbUnit | ||
+ | ==== Reserved Words ==== | ||
+ | |||
+ | * data types < | ||
+ | * byte | ||
+ | * short | ||
+ | * int | ||
+ | * long | ||
+ | * float | ||
+ | * double | ||
+ | * char | ||
+ | * boolean | ||
+ | * void | ||
+ | </ | ||
+ | |||
+ | * class & packages < | ||
+ | * class | ||
+ | * interface | ||
+ | * enum | ||
+ | * package | ||
+ | * import | ||
+ | * extends | ||
+ | * implements | ||
+ | * this | ||
+ | * super | ||
+ | * new | ||
+ | </ | ||
+ | |||
+ | * modifiers < | ||
+ | * public | ||
+ | * protected | ||
+ | * private | ||
+ | * static | ||
+ | * final | ||
+ | * abstract | ||
+ | * native | ||
+ | * volatile | ||
+ | * transient | ||
+ | * synchronized | ||
+ | * strictfp | ||
+ | </ | ||
+ | |||
+ | * operations < | ||
+ | * if | ||
+ | * else | ||
+ | * switch | ||
+ | * case | ||
+ | * default | ||
+ | * for | ||
+ | * while | ||
+ | * do | ||
+ | * break | ||
+ | * continue | ||
+ | * return | ||
+ | * instanceof | ||
+ | * assert | ||
+ | </ | ||
+ | |||
+ | * exceptions < | ||
+ | * try | ||
+ | * catch | ||
+ | * finally | ||
+ | * throw | ||
+ | * throws | ||
+ | </ | ||
+ | |||
+ | * others < | ||
+ | * const | ||
+ | * goto | ||
+ | </ | ||
===== References ===== | ===== References ===== | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |