Why we declare in the way List ab = new ArrayList(); what is the use of it?
Answer Posted / sravani gupta
When you declare List l = new ArrayList() l is limited to the methods provided by the interface List, while when you declare it ArrayList al = new ArrayList() it can use all methods and fields in an arraylist.
When you declare it List l then you afford yourself more flexibility as you can change out the ArrayList for something more appropriate at a later date if you want to without breaking any code
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is degree of a Relation?
xsqrt(0.09)=3 , then x equals
How many mod 3 counters are required to construct mod 9 counter.
The mean and the variance of a binomial distribution are 4 and 2 respectively. Then the probability of 2 successes is?
The Parallelogram PQRS, the line RS have midpoint T from line PQ. What is the ratio of Triangle PTS / parallelogram PQRS?
Hi, Can anybody please send me the last year question papers of Oriental Bank of Commerce PO exam. My email ID is: yamini.friend14@gmail.com Thanks.
A rectangular tank can hold m litres of milk. Find how many litres of milk can a tank hold when all its dimensions are doubled?
Bird is flying 120km/hr b/w b to r. Two trains at b to r at 60 kmph the distance traveled by the bird before it is killed.
2 oranges,3 bananas and 4 apples cost Rs.15 . 3 oranges 2 bananas 1 apple costs Rs 10. what is the cost of 3 oranges, 3 bananas and 3 apples ANs Rs 15.
epaulet : shoulder : : ring :?
pls send me andhra bank clerk model papers&syllabus
r= 5 n = 3 . If first pole has 2 flags ,third pole has 1 flag how many ways the remaining can be arranged?
Four Members A, B, C, D are playing a game .A person losing a game should double the amount of others .B, C, D are losing in order after three games .The amount after 3 games are A&B having 40,D is having 16&C 80. Who started with small amount of money?
if the word 'ddosszm' is changed to 'central' then what will be the change for 'rtjbl' ?
The difference between the compound and simple interest on a certain sum for 2 years at the rate of 8% per annum is Rs.80,What is the sum?