java - using elements from returned array -


get1 () method returns an array. I am getting the output but get1 () to code [[D @ addbf1

My question is that the straight array of returned Is there any way to use it to get value in IN1 [0] and IN1 [1] and show it in the output statement?

I am aware of other ways to show the production but I want to know whether I can retrieve the elements of the returned straight back array.

  class vehicle {double] inf1 = new double [2]; Zero set (double D, double S) {IN1 [0] = D; Inf1 [1] = s; } Double [] get1 () {return inf1; }} Public class calc2 {public static zero main (string agr []) {vehicle ob = new vehicle (); Ob .set (56.24, 75); System.out.println ("The time to cover" + ob.get1 ()); }}    

Yes, you can refer to the elements of the array through the Get1 () method:

get1 () [0] will work.

Comments