How to Declare String in Java?

`String str = “Hello”;`

`String str = new String(“Hello”);`

`String str;`

`str = “Hello”;`

`final String str = “Hello”;`

`String[] arr = {“Hello”, “World”};`

Suggested for You

Trending Today