개발일지/수업내용14 210817(목)_DAY 17 [Client & Server] - Client: 서비스를 받는 프로그램 - Server: 서비스를 제공하는 프로그램 [IP & Port] - IP: 컴퓨터의 고유 주소 - Port: 서버는 고정적인 포트 번호를 가지고 실행(binding) / 클라이언트가 서버에서 보낸 정보를 받을 때는 동적 포트 번호 사용 eg/ FTP 클라이언트(21번) → FTP 서버(21번) ▶ getLocalHost( ) / getByName( ) / getAllByName( ) - getLocalHost( ): 로컬 컴퓨터의 InetAddress 가져오기 - getByName( ): 매개 값으로 준 도메인 이름으로 DNS에서 하나의 IP를 가져와서 InetAddress 생성 & 리턴 - getAllByName( ): 하나의 .. 2021. 8. 12. 210810(화)_DAY 15 (String 메소드) [문자열을 대문자로 바꿔주는 메소드] java.lang > String > toUpperCase Converts all of the characters in this String to upper case using the rules of the default locale. This method is equivalent to toUpperCase(Locale.getDefault()). public static void main(String[] args) { String str = "The String class represents character strings."; String res = str.toUpperCase(); System.out.println(res); } ▶Console THE STRING.. 2021. 8. 10. 210809(월)_DAY 14 (charAt, toCharArray) // 추가 예정 charAt - Returns the char value at the specified index. 지정된 인덱스의 문자값을 반환 - Returns: The first char value is at index 0. 인덱스는 0부터 시작 - Throws: Index argument is negative or not less than the length of this string. 인덱스가 음수이거나 문자열의 길이보다 작을 때는 예외 eg/ public class P_Charat { public static void main(String[] args) { String str = "abcd"; System.out.println(str.charAt(0)); } } ▶Console a toCharArray - C.. 2021. 8. 10. 210805(목)_DAY 12 [Exception] 1. UnCheckedException : 프로그램을 실행 해봐야 오류가 나는지 안 나는지 알 수 있다. 문법적으로는 이상이 없기 때문에 예외처리는 필수가 아니다. 2. CheckedException : 컴파일 단계에서 오류를 확인할 수 있다. 예외처리 필수. Exception Class 중 RuntimeException을 제외한 모든 Class가 해당된다. * 예외 처리 방법: try ~ catch ~ finally - try: 예외가 확인되면 catch { }로 이동, 확인되지 않으면 finally { }로 이동 - catch: try에서 보낸 예외 처리 - finally: 예외 발생과 상관 없이 항상 수행 (필수 X) 2021. 8. 6. 이전 1 2 3 4 다음