Science, asked by aswany7927, 1 year ago

Which of these constructors is used to create an empty String object in Java? [MCQ]

Answers

Answered by AKASHDIPDAS
14
empty(String[]args) is used to create empty string object in Java.
Answered by brokendreams
0

Empty(String[]args) is used to create empty string objects in Java.

String() Constructor is used to creating an empty String object in java.

Empty String object in java:

  • Let's now create three empty Strings: String empty Literal = ";
  • String emptyNewString = new String(""); String emptyNewStringTwo = new String();
  • As we know by now, the empty literal will be added to the String pool, while the other two go directly onto the heap.
  • String Buffer class is used to create strings that can be modified after they are created.
Similar questions