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

solve (7x+4y)/(x-2y) if (x/2y)=(3/2)

5 Answers  


3x + 4y =15 so what is the slope of line which is perpendicular to this line.?

4 Answers  


Every year on the day of Janmashtami, both Mr. Deepak Patel and Mr. Radha Krishnan distribute sweets free of cost at their respective shops. Last year on the day of Janmashtmi, there were a total of 1013 and 1057 people standing in two different queues in front of the shops of Mr. Deepak Patel and Mr. Radha Krishnan respectively. If there are at least 3 women between any two men in each of these two queues, then the total number of men in both the queues cannot be more than

5 Answers  


Find the value of @@+25-++@1..., where @ denotes "square" and + denotes "square root".

0 Answers   Accenture,


solution for the question: NOON+MOON+SOON=JUNE, each alphabet represents the number. what is the answer? what does JUNE represents?

4 Answers   Infosys,


If a car starts from A towards B with some velocity.Due to some problem in the engine after travelling 30km, the car goes with 4/5 th of its actual velocity The car reaches B 45 min later to the actual time.If the car engine fails ofter travelling 45km, the car reaches the destination B 36min late to the actual time .What is the initial velocity of car and what is the distance between A and B in km ?

5 Answers   IBM,


Ann, Boobie, Cathy and Dave are at their monthly business meeting. Their occupations are author, biologist, chemist and doctor, but not necessarily in that order. Dave just told the biologist that Cathy was on her way with doughnuts. Ann is sitting across from the doctor and next to the chemist. The doctor was thinking that Boobie was a goofy name for parent's to choose,but didn't say anything. What is each person's occupation?

1 Answers   Infosys,


Which of the following equations has a root in common with x2 - 6x + 5 = 0?

7 Answers   Wipro,


A Farmer owns a square land of 15 m each side with a pole in one of the corners to which he tied his cow with a rope whose length is about 10 m. What is the area available for the cow to graze. (Assume pi = 3)

0 Answers   Accenture,


Find the hypotaneous of a right angle isosceles triangle whose area is 50.

0 Answers   COSL,


3978 + 112 x 2 = ? ? 2 (a) 8180 (b) 2101 (c) 4090 (d) 8404 (e) None of these

8 Answers  


512.85+376.598+(-402.8 +6x0)= ?

1 Answers  


Categories