Hey there! any question in your mind? Ask It Now!.

Popular Categories





How can i Store an object in array?

+5 votes
171 views
asked in Programming by jatin Expert (3,823 points)
How can i Store an object in array?

1 Answer

+1 vote
answered by payel (1,640 points)
selected by jatin
 
Best answer

i am here Initialising an array which will populates all positions with default value, array of objects the default value = null. see this code :

Customer[] cst = new Customer[3];

creates the following array:

{null, null, null}

There are several way to initialising arrays, but in case of 3 element array you can use this one:

Customer cst[] = {new Customer(), new Customer(), new Customer()};

Related Questions

+2 votes
1 answer 163 views
0 votes
1 answer 145 views
+2 votes
1 answer 1,066 views
+2 votes
3 answers 331 views
asked in Programming by jatin Expert (3,823 points)
+2 votes
1 answer 194 views
–1 vote
0 answers 176 views
0 votes
0 answers 97 views
+1 vote
1 answer 322 views
+2 votes
1 answer 165 views
+1 vote
1 answer 138 views

Not a Member yet?

Ask to Folks Login

My Account
439 Folks are online
0 members and 439 guest online
Your feedback is highly appreciated