public:computer:java

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
public:computer:java [2021/12/17 18:40] – [References] alexpublic:computer:java [2022/09/15 23:06] alex
Line 1: Line 1:
 ====== Java ====== ====== Java ======
  
 +  * ''String'' -> ''StringBuilder''
  
 +  * ''java.util.Date'' <-> ''java.time.Instant''
 +  * ''java.util.Calendar'' -> ''java.time.Instant''
 +  * ''java.text.SimpleDateFormat''
 +  * ''java.time''
 +    * 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("DRIVER");
 +  }
 +  catch(ClassNotFoundException e)
 +  {
 +    e.printStackTrace();
 +  }
 +  
 +  try
 +  {
 +    conn = DriverManager.getConnection("jdbc database", "user", "password");
 +    
 +    Statement stmt = conn.createStatement();
 +    ResultSet rset = stmt.executeQuery("QUERY");
 +    
 +    while(rset.next())
 +    {
 +      // do something
 +    }
 +  }
 +  catch(SQLException e)
 +  {
 +    e.printStackTrace();
 +  }
 +  finally
 +  {
 +    if(conn != null)
 +    {
 +      try
 +      {
 +        conn.close();
 +        conn = null;
 +      }
 +      catch(SQLException e)
 +      {
 +        e.printStackTrace();
 +      }
 +    }
 +  }
 +  
 +...
 +...
 +</sxh>
 +
 +  * conn.setAutoCommit(true/false);
 +  * conn.commit();
 +  * conn.rollback()
 +  * PreparedStatement stmt = conn.prepareStatement(".... ?");
 +    * stmt.setString(1, "value");
 +
 +  * DAO<sup>Data Access Object</sup>
 +  * DTO<sup>Data Transfer Object</sup>
 +  * JPA<sup>Java Persistence API</sup>
 +
 +
 +==== 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 <list-group>
 +  * byte
 +  * short
 +  * int
 +  * long
 +  * float
 +  * double
 +  * char
 +  * boolean
 +  * void
 +</list-group>
 +
 +  * class & packages <list-group>
 +  * class
 +  * interface
 +  * enum
 +  * package
 +  * import
 +  * extends
 +  * implements
 +  * this
 +  * super
 +  * new
 +</list-group>
 +
 +  * modifiers <list-group>
 +  * public
 +  * protected
 +  * private
 +  * static
 +  * final
 +  * abstract
 +  * native
 +  * volatile
 +  * transient
 +  * synchronized
 +  * strictfp
 +</list-group>
 +
 +  * operations <list-group>
 +  * if
 +  * else
 +  * switch
 +  * case
 +  * default
 +  * for
 +  * while
 +  * do
 +  * break
 +  * continue
 +  * return
 +  * instanceof
 +  * assert
 +</list-group>
 +
 +  * exceptions <list-group>
 +  * try
 +  * catch
 +  * finally
 +  * throw
 +  * throws
 +</list-group>
 +
 +  * others <list-group>
 +  * const
 +  * goto
 +</list-group>
  
 ===== References ===== ===== References =====
   * [[https://wikidocs.net/book/31|점프 투 자바]]   * [[https://wikidocs.net/book/31|점프 투 자바]]
   * [[https://m.blog.naver.com/ehe123/221290351142|[자바 IDE] IntelliJ vs Eclipse 비교]]   * [[https://m.blog.naver.com/ehe123/221290351142|[자바 IDE] IntelliJ vs Eclipse 비교]]
 +  * [[https://madplay.github.io/post/difference-between-dollar-sign-and-sharp-sign-in-mybatis|MyBatis에서 샾(#{})과 달러(${})의 차이는 무엇일까?]]
 +  * [[https://java-design-patterns.com/principles/|Java Design Patterns]]
 +  * [[https://github.com/iluwatar/java-design-patterns|Design patterns implemented in Java]]
 +  * [[https://github.com/lesstif/TIL/blob/master/JAVA/%EC%9E%90%EB%B0%94-%EC%BD%94%EB%93%9C%EB%A5%BC-%EC%A1%B0%EC%9E%91%ED%95%98%EB%8A%94-%EB%8B%A4%EC%96%91%ED%95%9C%EB%B0%A9%EB%B2%95.md|자바-코드를-조작하는-다양한방법.md]]
  • public/computer/java.txt
  • Last modified: 2022/09/15 23:21
  • by alex