Here you can find the source of toArray(Object a)
public static Object[] toArray(Object a)
//package com.java2s; /********************************************************************* * This computer program is the confidential information and proprietary * trade secret of Cisco Systems, Inc. Possessions and use of this * program must conform strictly to the license agreement between the user * and Cisco Systems, Inc., and receipt or possession does not convey * any rights to divulge, reproduce, or allow others to use this program * without specific written authorization of Cisco Systems, Inc. * * Copyright (c) 2001 by Cisco Systems, Inc. * All rights reserved.//from w w w . j a va 2 s. c o m * *********************************************************************/ public class Main { /** * Gives an Object array containing the passed parameter */ public static Object[] toArray(Object a) { return new Object[] { a }; } /** * Gives an Object array containing the passed parameters */ public static Object[] toArray(Object a, Object b) { return new Object[] { a, b }; } /** * Gives an Object array containing the passed parameters */ public static Object[] toArray(Object a, Object b, Object c) { return new Object[] { a, b, c }; } /** * Gives an Object array containing the passed parameters */ public static Object[] toArray(Object a, Object b, Object c, Object d) { return new Object[] { a, b, c, d }; } }