Difference between array and arraylist.

Answer Posted / vk

Array is a collection of similar data types,ArrayList is not you can store any type of data types in AL.ArrayList will autometically increase 50% of the size which we allocated previously, but Array wasn't.

ArrayList al= new ArrayList();
al.add("a");
al.add(10);

both can be accepted in ArrayList.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When throws keyword is used?

576


Difference between concurrent hashmap and hashtable and collections

560


How will you compute size of a structure?

575


What is the effect of keeping a constructor private?

470


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1562






who can i handle multiple client in RMI

1434


What is parsing a string?

586


What are the differences between heap and stack memory?

542


What is difference between static class and normal class?

526


Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.

1577


What do you understand by the term wrapper classes?

536


Can variables be used in java without initialization?

547


What do you mean by Function Overloading in java?

620


Is main an identifier?

545


How can we access some class in another class in java?

539