What is Difeerence between List obj=new ArrayList(); and
ArrayList obj=new ArrayList()?



What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?..

Answer / Ram Prakash Soni

There is no difference between List obj=new ArrayList<>() and ArrayList obj=new ArrayList<>. Both lines of code create a new instance of the ArrayList class and initialize it as a list.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

1 Answers   UBS,


What Is a Polymorphism? How many types of polymorphism and whats that use in application?

2 Answers  


What is difference between new and malloc?

7 Answers   emc2,


Can an interface inherit a class?

1 Answers  


How do you define a class in oop?

1 Answers  


What is constructor in oop?

1 Answers  


Why we are use # in begning of programme of c++.

2 Answers   Syntel,


What is the Advantage of Interface over the Inheritance in OOPS?

4 Answers  


What is oops in simple words?

1 Answers  


There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?

3 Answers   Microsoft,


Why interface is used?

1 Answers  


What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass

6 Answers   Wipro,


Categories