Why we declare in the way List ab = new ArrayList(); what is the use of it?
Answer / 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 |
a person left house with speed 40 mile per hour. His wife after 30 minutes left to catch him at a speed of 50 Miles Per Hour. in what time she will catch.
Joe started from Bombay towards pune and her friend julie in opposite direction.they meet at a point .distance travelled by joe was 1.8 miles more than that of julie.after spending some both started there way.joe reaches in 2 hours while julie in 3.5 hours. Assuming both were travelling with constant speed.Wath is the distance between the two cities.
in a question ,last part has, the ages of two people has the ratio of 6:6 and by adding the numbers we get 44, after how many years the ratio would be 8:7?
A sum 's' is divided into 4 parts. Second person gets Rs 10 more than first.3rd person is Rs 10 more than second, 4th is 10 more than 3rd. How much amount do 1st person get?
at a certain ice cream parlour customer can choose among three different ice cream flavour and can choose either a sugar cone or a waffle cone. considerig both ice cream flavour and cone type how many distinct tripple scoop cone with three different ice cream flavour and available.
What is the value of 15^2- 14^2 + 13^2- 12^2........-2^2+ l^2? 1.225 2.265 3.120 4.125
Ravi's salary was reduced by 25%.Percentage increase to be effected to bring the salary to the original level is
instead of multiplying by 7 to a number dividing by 7 what is the percentage of error
(7*7=49)(4*9=36)(3*6=18) (1*8=8)
If the ticket sales s for a company increases 25% from standard sales to 60 tickets sold, then 60 - s =:
price of a product is reduced by 30% . What percentage should be increased to make it 100%
5 women given some of their heights(tall,medium,short)Hair( long, plainted),stards(Black or Brown), sari,2 medium,2-short.Tall-no sari.Plainted-medium.Answer the combinations.