My question is that the straight array of returned Is there any way to use it to get value in 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. Yes, you can refer to the elements of the array through the get1 () method returns an array. I am getting the output but
get1 () to
IN1 [0] and
IN1 [1] and show it in the output statement?
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 ()); }}
Get1 () method:
get1 () [0] will work.
Comments
Post a Comment