Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
reserve array value
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { String input = "[5,4,1,9,8,3]"; char [] arrA = input.toCharArray(); System.out.print('['); for (int a = arrA.length-2; a >0; a--){ System.out.print(arrA[a]); } System.out.print(']'); //atau bisa pake yg dibawh ini /* char [] arrB = new char[arrA.length]; arrB[0] = '['; arrB[arrB.length-1] = ']'; for (int a = 1, b = arrB.length - 2; a < arrA.length-1; a++, b--){ arrB[b] = arrA[a]; } //menampilkan char for(char c : arrB){ System.out.print(c); } */ } }
run
|
edit
|
history
|
help
0
Cyclically rotate array
checkingWord
[Java] Coding - Reverse CODE - Mathematical Method
bit right 2
toStringMethodinJava
4a
SecToHours
epeenconverter
Java Replace Method
calc