Question
Question 11: -- Consider the statements below: String a = JAVA: ; String b = How to ; String c = Program; Which of the
Question 11: -- Consider the statements below: String a = "JAVA: "; String b = "How to "; String c = "Program"; Which of the statements below will create the String r1 = "JAVA: How to Program"? String r1 = c.concat(b.concat(a)); String r1 = a.concat(b.concat(c)); String r1 = b.concat(c.concat(a)); String r1 = c.concat(c.concat(b)); Flag this Question
Question 12: -- Which of the following is not a method of class String? toUpperCase trim toCharacterArray All of the above are methods of class String Flag this Question
Question 13: -- StringBuilder objects can be used in place of String objects if ________. the string data is not constant the string data size may grow the programs frequently perform string concatenation All of the above. Flag this Question
Question 14: -- Given the following declaration: StringBuilder buf = new StringBuilder(); What is the capacity of buf? 0 10 16 20 Flag this Question
Question 15: -- Which of the following statements is true? The capacity of a StringBuilder is equal to its length The capacity of a StringBuilder cannot exceed its length. The length of a StringBuilder cannot exceed its capacity. Both a and b are true. Flag this Question
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started