1) Which of these operators can be used to concatenate two or more String objects? a) A. + b) B. += c) C. & d) D. || 2) Which of these method of class String is used to obtain length of String object? a) A. get() b) B. Sizeof() c) C. lengthof() d) D. length() 3) Which of these method of class String is used to extract a single character from a String object? a) A. CHARAT() b) B. charat() c) C. charAt() d) D. ChatAt() 4) Which of these method of class String is used to compare two String objects for their equality? a) A. equals() b) B. Equals() c) C. isequal() d) D. Isequal() 5) Which of these method of class String is used to check weather a given object starts with a particular string literal? a) A. startsWith() b) B. endsWith() c) C. Starts() d) D. ends() 6) Which of these data type value is returned by equals() method of String class? a) A. char b) B. int c) C. boolean d) D. All of the mentioned 7) Which of these method of class String is used to extract a substring from a String object? a) A. substring() b) B. Substring() c) C. SubString() d) D. None of the mentioned 8) What will s2 contain after following lines of code? String s1 = "one";String s2 = s1.concat("two) a) A. one b) B. two c) C. onetwo d) D. twoone 9) Which of these method of class String is used to remove leading and trailing whitespaces? a) startsWith() b) B. trim() c) C. Trim() d) D. doTrim() 10) Which of the following statement is correct? a) replace() method replaces all occurrences of one character in invoking string with another character. b) replace() method replaces only first occurances of a character in invoking string with another character. c) replace() method replaces all the characters in invoking string with another character. d) replace() replace() method replaces last occurrence of a character in invoking string with another character. 11) . Which of the following statement is correct? a) reverse() method reverses all characters b) reverseall() method reverses all characters. c) replace() method replaces first occurrence of a character in invoking string with another character. d) replace() method replaces last occurrence of a character in invoking string with another character 12) What will be the output of the following program code? a) A. true b) B. false c) C. 0 d) D. 1 13) What will be the output of the following program? a) A. false true b) B. false false c) C. true false d) D. true true 14) What could be output of the following fragment of code? a) A. true b) B. false c) C. 0 d) D. Compilation error e) E. Throws Exception 15) What could be output of the following fragment of code?Determine output: a) A. Throws an exception as string and int are not compatible for addition b) B. hellow9 c) C. 9hellow d) D. Compilation error e) E. None of these 16) toString() method is defined inExamveda Examveda a) A. java.lang.String b) B. java.lang.Object c) C. java.lang.util d) D. None of these 17) The String method compareTo() returns a) A. true b) B. false c) C. an int value d) D. 1 e) E. -1 18) String str1 = "abcde"; System.out.println(str1.substring(1, 3)); a) A. abc b) B. bc c) C. bcd d) D. abcd e) E. None of these 19) What is the output of the following println statement? String str1 = "Hellow"; System.out.println(str1.indexOf('t')); a) A. true b) B. false c) C. 1 d) D. -1 e) E. 0 20) what will be the output of the following program? a) A. one b) B. two c) C. onetwo d) D. twoone e) E. None of these 21) String str1 = "Kolkata".replace('k', 'a'); In the above statement, the effect on string Kolkata is a) A. The first occurrence of k is replaced by a. b) B. All characters k are replaced by a. c) C. All characters a are replaced by k. d) D. Displays error message 22) The class string belongs to ................. package. a) A. java.awt b) B. java.lang c) C. java.applet d) D. java.string 23) What will be the output? a) A. one.two.three. b) B. Compilation fails because of an error at line 3 c) C. Compilation fails because of an error at line 5 d) D. An exception is thrown at runtime. e) E. None of these
0%
strings
공유
공유
공유
만든이
Upriyase
콘텐츠 편집
인쇄
퍼가기
더보기
할당
순위표
더 보기
접기
이 순위표는 현재 비공개입니다.
공유
를 클릭하여 공개할 수 있습니다.
자료 소유자가 이 순위표를 비활성화했습니다.
옵션이 자료 소유자와 다르기 때문에 이 순위표가 비활성화됩니다.
옵션 되돌리기
상자 열기
(은)는 개방형 템플릿입니다. 순위표에 올라가는 점수를 산출하지 않습니다.
로그인이 필요합니다
비주얼 스타일
글꼴
구독 필요
옵션
템플릿 전환하기
모두 표시
액티비티를 플레이할 때 더 많은 포맷이 나타납니다.
결과 열기
링크 복사
QR 코드
삭제
자동 저장된
게임을 복구할까요?