Question: Java Questions are in bold. Which of these is a valid way to create a String? (choose all that apply) Question 1 options: String s
Java Questions are in bold.
Which of these is a valid way to create a String? (choose all that apply)
Question 1 options:
| String s = "Hello"; | |||||||||||||||||
| String s = new String("Hello"); | |||||||||||||||||
| char[] arr = {'H', 'e', 'l', 'l', 'o'};String s = new String(arr); | |||||||||||||||||
| String s1 = new String("Hello"); String s2 = s1; Given the code below, which of these will return the boolean value true? String s1 = new String( hello ); String s2 = new String( hello ); Question 2 options:
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
