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

1,2,4,8,16,....,64,128,....,512

1 Answers  


What is the selling price of a scooter? If the cost of the scooter is Rs 50 and a profit of 10% over selling price is earned.

0 Answers   3i Infotech,


Input an array and then print the repeating characters?? Example: Input:1,3,23,11,44,3,23,2,3. Output:3,23 plz help me.... i want a code of it. In C language.

5 Answers   Nagarro, Wipro,


Total number of wheels of bicycles & 4 wheeled vechicles is 38. How many bicycles are there?

6 Answers   TCS,


The LCM of two numbers is 2079 and their HCF is 27. If one of the numbers is 189, find the other number. (a) 248 (b) 128 (c) 297 (d) 336 (e) None of these

12 Answers   Emphasis,


Find the hypotenuse of a right angle isoceles triangle whose area is 50.

0 Answers   Citicorp,


plz send test pattern of nsn engineers graduate.

0 Answers   MTN, Urjanet,


A person gives a secret to two other persons in 5 minutes. How long will he take to tell the secret to 768 people?

0 Answers   Accenture,


Instead of multiplying a number by 7, the number is divided by 7. What is the percentage of error obtained?

0 Answers   3i Infotech, Amazon, Canara Bank,


There are two natural numbers. A cube difference of the squares is a square difference of their cubes.These are the smallest possible numbers. what is the sum of these numbers?

0 Answers   HDFC,


A sum of Rs 312 is divided among 100 boys and girls such that every boy gets an amount of Rs 3.60 and every girl gets 2.40 Rs. Calculate the number of girls in the group.

0 Answers   CGI,


Find the 8th term in series: 2, 2, 12, 12, 30, 30, - - - - -

0 Answers   Infosys,


Categories