This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Can anyone please guide me how to execute doIt() on an int argument , if I already have var agrs argument method . The compilor refused to compile with an error . I mean I want both 1 and 2 to work ... Please point the error.
doIt(int... params) method takes in array of ints and its size would depend on number of ints you pass. doIt(int params) also takes an array of int and you cannot define 2 methods with same signature in same class, therefore you get an error saying doIt(int... p) is already defined in class.