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 speaks truth 70% of the times, B speaks truth 80% of the times.What is the probability that both are contradicting each other is ?

0 Answers   Flipkart, Wipro,


A cube 3"* 3"* 3" is painted green it is cut into 1"* 1"* 1" how many cubes were painted on atleast on one side

0 Answers   Caritor Solutions,


There are 3 societies a,b,c. a lent tractors to b and c as many as they had. After some time b gave as many tractors to a and c as many as they have. After sometime c did the same thing. At the end of this transaction each one of them had 24. Find the tractors each originally had.

0 Answers   IBM, Infosys,


a man is 24 years older than his son. In two years, his age will be twice the age of his son. The present age of his son is?

0 Answers  


One rectangular plate with lenght 8 inches, breadth 11inches and 2 inches thickness is there. What is the length of the circular rod with diameter 8 inches and equal to volume of rectangular plate?

0 Answers   HCL,


A man spends half of his salary on household expenses, 1/4th for rent, 1/5th for travel expenses, the man deposits the rest in a bank. If his monthly deposits in the bank amount 50, what is his monthly salary ?

0 Answers   Mu Sigma,


Aeroplane is flying at a particular angle and latitude,after some time another latitude is given..(8 hrs later), You are asked to find the local time of the place.

0 Answers   TCS,


A person starts walking at a speed of 5km/hr through half the distance, rest of the distance he covers with a speed 4km/hr. Total time of travel is 9 hours. What is the maximum distance he can cover?

0 Answers   Hexaware,


India : New Delhi : : Pakistan : ? (A) Lahore (B) Islamabad (C) Peshawar (D) Rawalpindi

7 Answers  


any body send me the sample paper for pnb dy.managers,to ravitejareddy.r@gmail.com

0 Answers   Punjab National Bank,


?Mango? is related to ?Fruit? in the same way as ?Potato? is related to (a) Fruit (b) Stem (c) Flower (d) Root (e) None of these

7 Answers   Infosys,


Find (7x + 4y ) / (x-2y) if x/2y = 3/2 ? (a) 6 (b) 8 (c) 7 (d) data insufficient Can anyone help me out to get answer for this question,i have exam on 6 th april can anyone find me the answer before that and post it please!!!!!!!!

15 Answers   TCS, Tech Mahindra, Titan, Unisys,


Categories