dcsimg
 

Submitted by: Octavia Anghel(octaviaanghel@gmail.com)

Wednesday Jun 13th 2018 by Octavia Anghel

Language: Java, Expertise: Intermediate - Learn how to avoid error-prone ways of passing data.

/**
* @returns [1]: Location, [2]: Customer, [3]: Incident
*/

Object[] getDetails(int id) {...

This sort of passing back values from a method is error prone; it is recommended to declare a small class that holds the objects together.

Details getDetails(int id) {...}

private class Details {
      public Location location;
      public Customer customer;
      public Incident incident;
}
Home
Mobile Site | Full Site
Copyright 2018 © QuinStreet Inc. All Rights Reserved