Java String Handling Test | Core Java Topical Test (Series 1)
Finish Quiz
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Java String Handling Test | Core Java Topical Test. Java String Handling Test Quiz 1, Core java Topical Tests have the best questions to make you understand the topic well. … This Test will cover String Handling from basic to advanced level..Free Java String Handling Quiz, Online Java, online Test Quiz 1. Java String Handling Test Quiz 1 Question and Answers 2019 is available for all users in Free . Now take Java online Test Quiz 1 in free from below…. Java String Handling Quiz 1 Free Mock Test 2019. Java String Handling Test Quiz 1 Question and Answers in PDF. The Java online mock test paper is free for all students. Java String Handling Test is very useful for exam preparation and getting for Rank. Java String Handling Test Quiz 1 Question and Answers in English. Java String Handling Mock test for topic via String Handling Mode. Here we are providing Java String Handling Mock Test in English Now Test your self for “Java String Handling Test in English” Exam by using below quiz…
This paper has 20 questions.
Time allowed is 25 minutes.
The Java String Handling Mock Test is Very helpful for all students. Now Scroll down below n click on “Start Quiz” or “Start Test” and Test yourself.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 20 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
What is the output of the following code ?
public static void main(String ags[]){
String a=”abc”;
String b=”abc”;
System.out.print(a.equals(b));
System.out.print(a==b);
}Correct
Incorrect
-
Question 2 of 20
2. Question
What is the output of the following program ?
public static void main(String ags[]){
String a=”abc”;
String b=new String(“abc”);
System.out.print(a.equals(b));
System.out.print(a==b);
}Correct
Incorrect
-
Question 3 of 20
3. Question
Examine this code:
String myString;
What is the data type of myString?Correct
Incorrect
-
Question 4 of 20
4. Question
Output of the below program ?
public static void main(String ags[]){
String a=new String(“abc”);
String b=new String(“abc”);
System.out.print(a.equals(b));
System.out.print(a==b);
}Correct
Incorrect
-
Question 5 of 20
5. Question
What sort of thing is “Nothing New” as in the following: String str = “Nothing New”;
Correct
Incorrect
-
Question 6 of 20
6. Question
What will be the output of the following code ?
public class Strings {
public static void main(String ads[]){
String arr[]={“meow”,”bray”,”moo”};
String a=”meow”;
System.out.println(arr[0]==a);
}
}Correct
Incorrect
-
Question 7 of 20
7. Question
What is the result of the following:
String ring = “One ring to rule them all, ”
String find = “One ring to find them.”if ( ring.startsWith(“One”) && find.startsWith(“One”) )
System.out.println( ring+find );
else
System.out.println( “Different Starts” );Correct
Incorrect
-
Question 8 of 20
8. Question
What type of object cannot be altered after it is constructed?
Correct
Incorrect
-
Question 9 of 20
9. Question
What is the output of the following program ?
public class Strings {
public static void main(String ads[]){
String a=”meow”;
String ab=a+”deal”;
String abc=”meowdeal”;
System.out.println(ab==abc);
}
}Correct
Incorrect
-
Question 10 of 20
10. Question
Examine this code:
String myString = “”;
What value is contained in myString?Correct
Incorrect
-
Question 11 of 20
11. Question
Examine this code:
String stringA = “Wild”;
String stringB = ” Irish”;
String stringC = ” Rose”;
String result;
Which of the following puts a reference to “Wild Irish Rose” in result?Correct
Incorrect
-
Question 12 of 20
12. Question
What is said of an operator like “+” when it has several meanings depending on context?
Correct
Incorrect
-
Question 13 of 20
13. Question
When an object no longer has any reference variables referring to it, what happens to it?
Correct
Incorrect
-
Question 14 of 20
14. Question
What is the result of the following:
String stringA = ” Wild ” ;
String stringB = ” Irish “;
String stringC = ” Rose “;
String result = stringA.trim() + stringB + stringC.trim();Correct
Incorrect
-
Question 15 of 20
15. Question
What value is assigned to a reference value to show that there is no object?
Correct
Incorrect
-
Question 16 of 20
16. Question
What is output?
- public class Test10
- {
- public static void main(String a[])
- {
- String s1 = “Sun”;
- String s2 = “Java”;
- s1.concat(s2);
- System.out.println(s1);
- }
- }
Choose the correct answer
Correct
As String class is immutable – class String does not contain methods that change the content of the String object itself. The concat() method returns a new String that contains the result of the operation. Hence for above code snippet output is ‘Sun‘.
Incorrect
As String class is immutable – class String does not contain methods that change the content of the String object itself. The concat() method returns a new String that contains the result of the operation. Hence for above code snippet output is ‘Sun‘.
-
Question 17 of 20
17. Question
What will be result if you try to compile and run following code?
public class Record extends String{}
Correct
As String class is declared as final you cannot extend String class.
The above code snippet gives, Compile time error , “Can not extend a final class.”Incorrect
As String class is declared as final you cannot extend String class.
The above code snippet gives, Compile time error , “Can not extend a final class.” -
Question 18 of 20
18. Question
What is the output?
String s1 = new String(“hi”);
String s2 = “hi”;
System.out.println(s1==s2);
System.out.println(s1.equals(s2));Correct
As s1 and s2 are s2 refer to different object, when we use == operator it checks whether two reference point two same object and equals() method checks the content of reference object. Hence when we execute above code snippet, output is – ‘false true‘
Incorrect
As s1 and s2 are s2 refer to different object, when we use == operator it checks whether two reference point two same object and equals() method checks the content of reference object. Hence when we execute above code snippet, output is – ‘false true‘
-
Question 19 of 20
19. Question
Examine the following code :-
String str = “Hot Java”;
boolean bValue = str instanceof String;What value is placed in bValue?
Correct
instanceof is used to check if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface. In the above code snippet str is an instance of String class, so the output is TRUE.
Incorrect
instanceof is used to check if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface. In the above code snippet str is an instance of String class, so the output is TRUE.
-
Question 20 of 20
20. Question
Which one of the following statements is true?
Correct
As String class is declared as final it cannot be subclassd.
Incorrect
As String class is declared as final it cannot be subclassd.