0

how to execute the below java logic

class Test2 { public static void main(String[] args) { new Test2().method("1st"); new Test2().method("1st","2nd"); } public void method(String...y) { System.out.println(y[y.length -1].charAt(0)); }

9th May 2018, 6:47 PM
ganga
1 Answer
0
You want the output? I think it's 1 2
9th May 2018, 11:13 PM
Martin Soukup
Martin Soukup - avatar