I would like to create a series of Strings:
String a="";
String b="";
String c="";
String d="";
String e="";
And I would like to create a String Array to put these Strings into it, and I've tried to write like this:
String[] abcde = {"a","b","c","d","e"}
but it's not my desire as i just want the Strings to be empty... Sorry i know it seems just a simple question to you, but i'm a new learner, looking forward to hearing your help. Thanks!
This is a fairly simple task, you will simply want to use:
String[] abcde = {a, b, c, d, e}
You are wrapping your initial variables with "", this refers to a being "a" which is now a string with the character a.
I hope that will help you address your problem and here is a link for further help with strings. Strings Java
just remove quotes
String[] abcde = {a, b, c , d , e };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With