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
box 1 cotain odd value X or Y the box 2 =X i.e 7 or 12 box 3= Y has value 19 if X is 7 or 31 if x is 12 get even value X or Y Use any operator steps allowed 3
a father is 30 times more than his son however he will be only thrice as old as the son what is father's present age ?
If a square is formed by the diagonal of the square as an edge, what is the ratio between the area?
An apple seller is having some apples. He is selling half of the apple what he has plus half the apple to the first customer. In the same way he sells the remaining apple to 7 customers. After selling to 7 customers, he has no apples with him.
In a class of 60 students, a student of weight 45 Kg leaves the class. The average weight of the class is then increased by 200 gms. What is the average weight of the remaining 59 students in the class?
if x/y =4 and y is not '0' what % of 'x' is '2x-y'
a hollow space on earth surface is to be fille((d) total cost of filling is rs 20000. The cost of filling per mt3 is rs 225 .how many times a size of 3 mt3 soil is required to fill the hollow space?
In a storage stall of 5x3x2inch.How many blanks of size 2x1x1inch can be stored..
How many liters of water must be added to 30 liters of alcohol to make a solution that is 25%
if the sum of five consecutive nos. 35? how many prime numbers are there :
Time and speed time and work boat and streams
Respected Sir/Mem Plz send me all 5 years solved question papers of sbi clerk on my Gmail id and that is chandelmishel@gmail.com
A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?
Two coins one with HEAD IN BOTH SIDES and the other coin HEAD IN ONE SIDE AND TAIL IN THE OTHER SIDE is in a box,a coin is taken at random and FOUND HEAD IN ONE SIDE .what is the probability that THE OTHER SIDE IS HEAD?
which country is following one party system