Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why we declare in the way List ab = new ArrayList(); what is the use of it?



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

Post New Answer

More General Aptitude Interview Questions

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.

3 Answers   COSL,


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.

0 Answers   Infosys,


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?

0 Answers   TCS,


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?

0 Answers   Wipro,


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.

2 Answers   MNIT,


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

1 Answers   CSC,


Ravi's salary was reduced by 25%.Percentage increase to be effected to bring the salary to the original level is

0 Answers   Wipro,


instead of multiplying by 7 to a number dividing by 7 what is the percentage of error

0 Answers   IIT Delhi,


(7*7=49)(4*9=36)(3*6=18) (1*8=8)

0 Answers   Accenture,


If the ticket sales s for a company increases 25% from standard sales to 60 tickets sold, then 60 - s =:

2 Answers   Accenture, Valtech,


price of a product is reduced by 30% . What percentage should be increased to make it 100%

6 Answers   CMC,


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.

0 Answers   Infosys,


Categories