The Artima Developer Community
Sponsored Link

Java Buzz Forum
advantages and disadvantages of array java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
instanceof java

Posts: 576
Nickname: instanceof
Registered: Jan, 2015

instanceof java is a java related one.
advantages and disadvantages of array java Posted: May 6, 2017 11:32 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by instanceof java.
Original Post: advantages and disadvantages of array java
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java

Advertisement

Disadvantages of array in java

  • Using Arrays we can store homogeneous elements only. means we can store all integers or all characters.
  • So arrays are Strongly Typed.
  • Arrays does not have add or remove methods.
  • We need to mention the size of the array. Fixed length.
  • So there is a chance of memory wastage.
  • To delete an element in an array we need to traverse through out the array so this will reduce performance.

Advantages of arrays:



  • We can access any element randomly by using indexes provided by arrays.
  • Primitive type to wrapper classes object conversion will not happen so it is fast.
  • Array can store many number of elements at a time.



Arrays in java   InstanceOfJava

Java interview programs on arrays:

  • Check below for some of the interesting java interview programs on arrays.

Five different ways to print arrays in java:



Creating array of objects in java:



Java program to find missing numbers in an array:



Find second highest number in java arrays:




Convert arrayList to array:

Copy all elements of  hash set to Object array:


Read: advantages and disadvantages of array java

Topic: Java xor operator with example programs Previous Topic   Next Topic Topic: How to check if a character is a special character in java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use