Which of the following statements is preferred to create a string "Welcome to Java Programming"?
Options
- String str = “Welcome to Java Programming”
- String str = new String( “Welcome to Java Programming” )
- String str; str = “Welcome to Java Programming”
- String str; str = new String (“Welcome to Java Programming” )
CORRECT ANSWER : String str = “Welcome to Java Programming”
Write your comments