
Stings, Cloning and ArrayList
Authored by Jeevitha P
Computers
University
Used 14+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of this method of class StringBuffer is used to concatenate the string representation to the end of invoking string?
concat()
append()
join()
concatenate()
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Java program?
class output
{
public static void main(String args[])
{
String a = "hello i love java"; System.out.println(a.indexOf('e')+" "+a.indexOf('a')+" "+a.lastIndexOf('l')+" "+a.lastIndexOf('v'));
}
}
6 4 6 9
5 4 5 9
7 8 8 9
1 14 8 15
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Java code?
class output {
public static void main(String args[])
{
StringBuffer sb=new StringBuffer("Hello"); sb.replace(1,3,"Java");
System.out.println(sb);
} }
Hello java
Hellojava
HJavalo
Hjava
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Java code?
class output
{
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer("Hello World"); s1.insert(6 , "Good ");
System.out.println(s1);
} }
HelloGoodWorld
HellGoodoWorld
HellGood oWorld
Hello Good World
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of these method of Object class can clone an object?
Objectcopy()
copy()
Object clone()
None of the above
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of these class can generate an array which can increase and decrease in size automatically?
ArrayList()
DynamicList()
LinkedList()
MallocList()
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of these method can be used to increase the capacity of ArrayList object manually
Capacity()
increaseCapacity()
increasecapacity()
ensureCapacity()
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?