1. public class Alpha{ 2. private static Character() ids; 3. 4. public static void main( String[] args){ 4. ids = new Character[args.length]; 5. for (int i=0; i<ids.length; i++){ 6. ids[i] = new Character( args[i] ); 7. System.out.print( ids[i] ); 8. } 9. } 10. } What is correct? A. Compilation fails. B. The code runs with no output. C. An exception is thrown at runtime. D. The code runs, outputing a concatenated list of the arguments passed to the program. Answer: A Explanation: Compilation fails. Line 2: Return Type required Why ?? Thanks !!
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
posted
0
What does this mean to you? Is it a method or what? [ September 15, 2004: Message edited by: Barry Gaunt ]
Buddy, either you need to type the questions correct or please specify the source. Most important please try the questions yourself before you post on the ranch.. atleast run the code once.
Jeff Lloyd
Greenhorn
Joined: Sep 15, 2004
Posts: 4
posted
0
Presumably the round brackets on line 2 make the compiler think you are trying to declare a public static method which would require a return type that is missing. If the brackets were [] then you're declaring an array variable and the compiler is happy.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.