Java 배우기145 Questions and Exercises: Characters and Strings Questions and Exercises: Characters and StringsQuestions다음 string builder의 최초 용량은 무엇입니까? What is the initial capacity of the following string builder?StringBuilder sb = new StringBuilder("Able was I ere I saw Elba."); Consider the following string:String hannah = "Did Hannah see bees? Hannah did."; What is the value displayed by the expression hannah.length()?What is the value returned by the me.. 2016. 1. 5. Autoboxing and Unboxing 오토박싱과 언박싱 Autoboxing and Unboxing 오토 박싱(Autoboxing)은 자바 컴파일러가 원시 타입과 해당 객체 래퍼 클래스 사이에서 만드는 자동 변환입니다. 예를 들어, int를 Integer로, double을 Double 등으로의 변환입니다. 변환이 다른 길로 가면, 그것을 unboxing이라 합니다. 가장 간단한 autoboxing의 예: Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to .. 2016. 1. 5. Summary of Characters and Strings 글자와 문자열 요약 글자와 문자열 요약 Summary of Characters and Strings단일 글자(character) 값을 사용하는 경우, 대부분은 원시 char 타입을 사용합니다. 하지만, 예를 들어 객체가 기대되는 경우 메소드 아규먼트로써, char를 객체로 사용할 필요가 있는 경우가 있습니다. 자바 프로그래밍 언어는, 이러한 목적에서 객체 Character 안의 char을 "wraps" 하는 wrapper 클래스를 제공합니다. 타입 Character의 객체에는, 그 타입이 char인 단일 필드가 포함됩니다. 클래스 Character는 또한 글자 조작을 하는데 많은 유용한 클래스 (예, static) 를 제공합니다. Most of the time, if you are using a single characte.. 2016. 1. 5. The StringBuilder Class 클래스 StringBuilder 클래스 StringBuilder The StringBuilder Class 수정될 수 있다는 점을 제외하고, 객체 StringBuilder는 객체 String과 동일합니다. 내부적으로, 이들 객체는 일련의 글자를 포함하는 가변-길이 배열처럼 취급됩니다. 어떤 시점에서, 일련의 길이와 내용은 메소드 호출을 통해 변경 될 수 있습니다.string builder가 보다 단순한 코드 (이 섹션의 끝에 샘플 프로그램 참조) 또는 보다 나은 성능의 코드로 이점을 제공하지 않는 한, 항상 strings를 사용해야 합니다. 예를 들어, 많은 수의 문자열을 이어붙여야 한다면, 객체 StringBuilder에의 추가가 보다 효율적입니다.StringBuilder objects are like String objects, e.. 2016. 1. 5. Comparing Strings and Portions of Strings 문자열과 문자열 일부의 비교 문자열와 문자열 일부의 비교 Comparing Strings and Portions of Strings 클래스 String에는 문자열과 문자열 일부를 비교하는 많은 메소드들이 들어 있습니다. 다음 표는 이들 메소드의 목록입니다. The String class has a number of methods for comparing strings and portions of strings. The following table lists these methods. 문자열 비교를 위한 메소드 Methods for Comparing Strings MethodDescriptionboolean endsWith(String suffix) boolean startsWith(String prefix)문자열이 메소드의 아규먼트.. 2016. 1. 5. Manipulating Characters in a String String 안에서 글자 조작하기 String 안에서 글자 조작하기 Manipulating Characters in a String 클래스 String은 strings의 내용을 검사하고, string에서 글자 또는 substrings을 찾고, 소문자 또는 대문자로 바꾸는 등 많은 메소드를 갖고 있습니다. The String class has a number of methods for examining the contents of strings, finding characters or substrings within a string, changing case, and other tasks. 인덱스로 글자와 Substring 확보하기 Getting Characters and Substrings by IndexcharAt() accessor .. 2016. 1. 5. 이전 1 ··· 4 5 6 7 8 9 10 ··· 25 다음