Exception Handling ◆ try - catch - finally◇ try◇ catch◇ finally ◆ throw / throws◇ throw - create exception object◇ throws - pass the exception to other class to solve ◆ 각종 exceptionhttp://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html Computers/Language java 2011.04.20
String class ◆ String Tokenizer가변길이 자료구조◇ ArrayList - size()- addElement() , elementAt()- wrapperClass 개입 ◇ Enumeration- 몇 개가 존재하는지는 모르지만, 비었는지 여부는 알 수 있음- hasMoreElements() ===> hasMoreTokens() 는 StringTokenizer- 원소 빼기... nextElement() ===>nextToken() 는 StringTokenizer- wrapperClass 개입 기타 ---startsWith()endsWith() Computers/Language java 2011.04.20
bytearray 를 string 으로 (from bytearray to string) /* * This method converts an byte array to a String object. */ public void convertByteArrayToString() { byte[] byteArray = new byte[] {87, 79, 87, 46, 46, 46}; String value = new String(byteArray); System.out.println(value); } 출처:http://www.javadb.com/convert-byte-array-to-string Computers/Language java 2011.04.12
Access specifier / Modifier Access specifier 접근자 관련 참고 링크(+출처)::http://download.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html ♩ Top Level - public, no modifier♪ Member Level - public, private, protected, package-private ◆ public - visible to all classes everywhere ◆ private - member can only be accessed in its own class ◆ protected - member can only be accessd within itw own package+ by a subclass of its class .. Computers/Language java 2011.04.10
Interface / polymorphism / Event Handling / Inheritance / GUI 전용뷰어 보기ch11. Interface and Polymorphism - ★ 코드의 재사용, ★ polymorphism으로 구현- inner class는 implements로 event-handler interfaces하는 classes에 유용 To learn about interfaces (인터페이스에 대해 배우기)Interface : A model for a class that specifies the fields and methods that must be present in a class that implements the interface실행되어야 하는 중요한 코드를 more general, more reusable 하게 한다Interface의 특징 ( 클래스와의 차이점 )Abstract (추.. Computers/Language java 2011.04.10
week11. Input/Output and Exception Handling ◆ Reading Text Files- Simplest way to read text : Use Scanner Class- To read from a disk file, construct a FileReader . Then, use the FileReader to construct a Scanner objectFileReader reader = new FileReader(File variable);Scanner in = new Scanner(File variable);- Use the Scanner methods to read data from file* next, nextLine, nextInt, and nextDouble ◇ Reading Words- The next method reads a wor.. Computers/Language java 2011.04.10
week10. Inheritance ◆ Inheritance - 1 class - 1 extend ◆ Inheritance Hierarchies- Set of classes con form an inheritance hierarchy* Classes representing the most general concepts are near the root, more specialized classes towards the branches : ◇ Superclass : more general class◇ Subclass : more specialized class that inherits from the superclass ◇ Inheritance is a mechanism for extending existing classes by adding.. Computers/Language java 2011.04.10
week9. Interfaces and Polymorphism ◆ Interfaces vs. Classes◇ Interface type - All methods are abstract : they don't have to implementation- All methods in an interface type are automatically public- An interface type does not have instance fields ◈ Interface: collection of abstract methods◈ Abstract methods: methods without body/implementation ◆ Declaring an Interfacepublic interface InterfaceName{ method signatures}- don't have .. Computers/Language java 2011.04.10
week8. Graphic User Interface week7. practical lab test ~ pass (...ㅠ.ㅜ...망했따능)다음주 시험은 잘봐야지!!! ◆ Graphic Applications and Frame Windows◇ Steps to show a frame1. Construct and object of the JFrame classJFrame frame = new JFrame();2. Set the size of the frameframe.setSize(300,400);3. If you'd like, set the title of the frameframe.setTitle("An Empty Frame");4. Set the "default close operation"frame.setDefaultCloseOperation(JFram.. Computers/Language java 2011.04.10
week6. Arrays and Array List ◆ Nested Loop- Put loops together!- 2중 for문/3중 for문/ .. 등을 일컫는 말 ◆ Random Numbers and Simulations- In a simulation, you repeatedly generate random numbers and use them to simulate an activity- Random number generatorRandom generator = new Random();int n = generator.nextInt(a); // 0 < = n < a double x = generator.nextDouble(); // 0 don't length())- Index values range from 0 to length -1- Accessin.. Computers/Language java 2011.04.10