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 the use of private constructor in core java?

3 Answers   OnMobile, Satyam, Yash Technologies,


How to Sort Strings which are given in List and display in ascending order without using java api.

1 Answers   LIC,


There are 100 keys and values in HashMap.how to get the keys and values?

1 Answers   IBS,


what is Portal(web based online portal)?

2 Answers   AIG,


How to add two numbers with out using Arithmetic , union operators in java....? But we can use bitwise operators... but how...?

4 Answers   CTS, Satyam,


What is a protected void?

0 Answers  


What are streams in java 8?

0 Answers  


methods in Applet?

1 Answers  


Implement two stacks using a single array.

0 Answers   Global Logic,


Why would you desing a J2EE application so user data is entered by way of a JSP page and managed by an underlying Java Beans class?

5 Answers   Adobe,


Why is java logo a cup of coffee?

0 Answers  


What is bom encoding?

0 Answers  


Categories