java - Change an array to a string without creating a string -


I want to complete:

  string [] beef = new string [3] ; Beef [0] = "water"; Beef [1] = "chicken"; Beef [2] = "paper"; String empo = Arrays.toString (beef); If (empo.isEmpty ()) {empo = "nothing"; Println (EMPO); } Else {System.out.println (empo); }   

without creating a string.


Something like this:

  string [] beef = new string [3]; Beef [0] = "water"; Beef [1] = "chicken"; Beef [2] = "paper"; Arrays.toString (beef); // Beef changes only on a plain string if (beef. Iseti ()) beef == "") {no = "nothing"; Println (beef);   

How about going about this?

You can not.

JAVA is another type of language that means that you have to tell that when you declare it (strong typing), then what type of thing will you be, and you type that ) Can not change it anytime after.

You just create a new string

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

java - Reaching JTextField in a DocumentListener -

c# - Add Image in a stackpanel based on textbox input -