N
N
Neonoviiwolf2016-07-18 22:08:35
Java
Neonoviiwolf, 2016-07-18 22:08:35

What is the value of an empty String in Java?

Good!
Even I can’t find what is stored in an empty String?
String str = "";
Just need to check if String is empty

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Vitrenko, 2016-07-18
@Neonoviiwolf

Oddly enough, an empty string stores an empty string in itself .
And indeed, there is a special method

if(string.isEmpty()){
    //code
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question