how to accept integer array in java

Answer Posted / saluru srinivasa rao

int []anarray=new int[10];
for(int i=0;i<=anarray.length;i++)
{
anarray[i]=i;
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference amongst jvm spec, jvm implementation, jvm runtime ?

516


Can we make main() thread as daemon?

585


how does the run() method in runnable work? : Java thread

520


Can we have multiple classes in a single file?

520


Give few examples of final classes defined in Java API?

710






How can we create objects if we make the constructor private ?

551


What are the differences between the constructors and methods?

592


Can a string be null?

550


What is the use of join method?

583


Explain some best practices you would apply while using collection in java?

576


How would overload a function based on return type?

555


What is the constructor?

593


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

1374


Is arraylist zero based?

562


How does indexof work?

515