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 ship started from port and moving with I mph and another ship started from L and moving with H mph. At which place these two ships meet ?

0 Answers   Accenture,


The perimeter of a rhombus is 52 units. One of its diagonal is 24 units.What is its second diagonals length?

0 Answers   Hexaware,


I have applied for IOb and APGVB Recruitment.Can anyone pls send me the Aptitude Questions For Bank Recruitments

0 Answers  


Thirty men take 20 days to complete a job working 9 hours a day.How many hour a day should 40 men work to complete the job? (a) 8 hrs (b) 7 1/2 hrs (c) 7 hrs (d) 9 hrs

5 Answers   Infosys, Thomson Reuters,


there are two categories of persons in ratio a:b = 2:3. A type earns 2.5 dollars/hr and b type 1 dollar/hr total money earned by both is 24dollars. Then what is the total number of persons

0 Answers   TATA,


In a mixture, R is 2 parts and S is 1 part. In order to make S to 25% of the mixture, how much of R is to be added?

0 Answers   Accenture,


6*12*15 is the volume of some material. How many cubes of edge 3 can be inserted into it?

4 Answers   Bhel, L&T, Lucent,


In acolony there are some families. Each of them have children butdifferent in numbers.Following are conditions a> no of adult>no of sons>no of daughters>no of families. b>each sister must have atleast one brother and should have at the most 1 sister. c> no of children in one family exceeds the sum of no of children in the rest families. Tell the no of families?

2 Answers   Cognizant, CTS, IEG, Satyam, TCS,


Two computers each produced 48000 public utility bills in a day. One computer printed bills at the rate of 9600 an hour and the other at the rate of 7800 an hour. When the first computer finished its run, how many bills did the other computer still have to print?

2 Answers   Cap Gemini, TCS,


Find the correct meaning of the following phrase: Penny wise pound foolish

0 Answers   Hexaware,


4i+8j+10k. something like this.

0 Answers   3D PLM,


In an examination 30% of the students failed in Maths, 40% failed in Science and 25% failed in both the subjects. If 220 passed in both the subjects. Find the number of students appeared in the examination?

0 Answers  


Categories