is this possible to create an array of 0 length?
if so how? if not so why?
coz we have an array in main() likw this
"static void main(String [] s) then what it signifies?

Answers were Sorted based on User's Feedback



is this possible to create an array of 0 length? if so how? if not so why? coz we have an array in..

Answer / priyanjan

Yes,it is possible to create the array of length 0. by
defining as:
int[] arr = {};

String[] s signifies the command line argument

Is This Answer Correct ?    29 Yes 0 No

is this possible to create an array of 0 length? if so how? if not so why? coz we have an array in..

Answer / ravikiran

it infers that the main method is capable of holding string
array as an argument

Is This Answer Correct ?    7 Yes 0 No

is this possible to create an array of 0 length? if so how? if not so why? coz we have an array in..

Answer / sushila

yes we can create array with 0 length.

public class A
{
static int b[];
public static void main(String args[])
{
System.out.println("-----------------");
System.out.println(b);
System.out.println("-----------------");
}
}

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is object deep copy and shallow copy and why it is required?

2 Answers  


What does nextint () do in java?

0 Answers  


How many objects are created for a singleton class

7 Answers   Ness Technologies,


How can constructor chaining be done using this keyword?

0 Answers  


How do you insert a line break?

0 Answers  






If an object is garbage collected, can it become reachable again?

0 Answers  


Can we modify the throws clause of the superclass method while overriding it in the subclass?

0 Answers  


What are the OOAD concepts in java explain with examples?

4 Answers   Aricent, CTS,


Why we use protected in java?

0 Answers  


What is a pattern what is an anti pattern?

0 Answers  


What is Garbage Collection in Java

0 Answers   Wipro,


Why call by value prevents parameter value change?

0 Answers  


Categories