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

Select from the below given choices, the one which most logically complements the idea in the main sentence or concludes from it. On the moral side, there are compelling arguments for an end to the hand - pulled rickshaws of Kolkatta. a) The West Bengal govt has decreed that hand - pulled rickshaws will be banned by the year end. b) The bengalis believe that by using the rickshaws they are saving a man from hunger. c) The hand pulled rickshaws is a slur on humanity with one human being pulled by another, d) The rickshaw puller belong to other states who came to West Bengal, fleeing poverty and hunger

1 Answers  


A certain type of mixture is prepared by mixing brand A at Rs.9 a kg. with brand B at Rs.4 a kg. If the mixture is worth Rs.7 a kg., how many kgs. brand A are needed to make 40kgs. of the mixture?

0 Answers   Wipro,


The largest Employer in the world ___________

7 Answers  


a dog takes 4 leaps for every 5 leaps of a hare but 3 leaps of a dog are equal to 4 leaps of the hare .compare their speeds(.......... please give explanation....)

14 Answers   College School Exams Tests, Infosys, SSC, Syntel,


In a certain department store, which has four sizes of a specific shirt, there are 1/3 as many small shirts as medium shirts, and 1/2 as many large shirts as small shirts. If there are as many x-large shirts as large shirts, what percent of the shirts in the store are medium?

7 Answers   Wipro,


A sphere of 10.5 cm radius is melted. It is then casted into a cuboid of maximum volume. What will be the total surface area of such cuboid?

0 Answers   Cap Gemini,


E=I*I*R what is the effect of E when I becomes I/2

6 Answers   Wipro,


There are 5 red shoes, 4 green shoes. If one draw randomly a shoe what is the probability of getting red shoe

0 Answers   Ramco,


There are two water tanks A and B, A is much smaller than B. While water fills at the rate of 1 liter every hour in A, it gets filled up like, 10, 20, 40,80, 160…..in tank B. 1/8 th of the tank B is filled in 22 hours. What is the time to fill the tank fully?

5 Answers   TCS,


Question from IIM - Company Management interview.   There are Nine children in the house, and all 9 of them are in the house  A is ironing  B is watching tv  C is cooking  D is playing chess  E is bathing  F is listening radio  G is sleeping  I is dressing   wat is H doing?  Think wisely answer logically.👍😉

8 Answers   TKB,


George while driving along the highway saw road markers which are at equal distances from each other. He crosses the markers every 20 seconds. If he increases his speed by x meters per second, he crosses the markers at every 15 seconds. But if he increases his speed by y meters per second, he crosses the marker at every 10th second. If y-x = 40 meters per second, then what is the distance between two markers.

0 Answers   TCS,


In a certain code, ?BELIEF? is written as ?AFKKDI?. How is ?SELDOM? written in that code ? (A) RDKCNL (B) TFKENP (C) RFKENM (D) RFKFNP (E) None of these

3 Answers  


Categories