ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
if arraylist size is increased from initial size what is 
the size of arraylist...suppose initial is 100 , if i add 
101 element what is the size...
 Question Submitted By :: Dharmendra
I also faced this Question!!     Rank Answer Posted By  
 
  Re: if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
Answer
# 1
same 100 since the count starts from 0 onwards its obcious
tat u wud have 101 elements
 
Is This Answer Correct ?    5 Yes 12 No
Sri
 
  Re: if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
Answer
# 2
The size of the arraylist will increase to 150 why because 
in arraylist the elements are reach to initial size of the 
array list then size will be increase to half of the 
capacity
 
Is This Answer Correct ?    16 Yes 2 No
Ravindra Reddy
 
 
 
  Re: if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
Answer
# 3
remember.. there are 2 things involved.. capacity and size..
capacity represents how many max elements the list can
accomodate in it, size represents how many elements are
present currently in the list..the capacity is automatically
increased by certain amount (10, 20, 30..) based on the
current size once the size is equal to capacity..
 
Is This Answer Correct ?    1 Yes 1 No
Siri
 
  Re: if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
Answer
# 4
when we create the arraylist, we have two factors
 1- inital size of array list,
 2 - load factor (default is .75).

load factor means size of the arraylist will be doubled if
we fill 75% of the size availabe.

i mean if intial size of arraylist is 100 then when we will
insert 75th element in the arraylist, its size will be doubled.
 
Is This Answer Correct ?    4 Yes 1 No
Anjani
 
  Re: if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
Answer
# 5
(initial capacity*3/2)+1
(100*3/2)+1
 
Is This Answer Correct ?    0 Yes 0 No
Reddy
 
  Re: if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
Answer
# 6
Arraylist are growble nature.so present capacity of arraylist 
100 then add an 101 element then that time  current capacity
is formula
 (101*3/2)+1=151
 
Is This Answer Correct ?    0 Yes 0 No
Srinu
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Why Java is a platform independent language? Zensar4
Howmany number of objects we can store in an ArrayList. Is there any limit? TCS5
How to eliminate duplicates from an array? Wipro3
What is the difference between a public and a non-public class?  2
how can u create the object with out new operator  2
How can we find size of the object ? RazorSight1
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod TCS3
In the first round, there are 30 aptitude and 30 java questions. We are suppose to finish both the papers within 60 minutes. I cleared this round. Next was test for programming skills. In this section, Some 7 n's were asked. 1. What is the difference b/w sleep(1000) and wait(1000) 2. what is the diff b/w static block and static function? 3. Write a program to validate IP address using string tokenizer. 4. Write a program to create singleton class 5. write a function to reverse the string 6. Write a prog to print prime nos upto n. EX: If n=9, It shld print 1,2,3,5,7 7. One program on collections- Write a program to print no. of times a number is repeating in an array. EX- {1,3,1,2,5,7,3,7,34,3,8,3} It should print: 1- 2 times 3- 4 times and so on 7. Write a func to print fibonocci series After this I had technical interview, which went on for. 60 mins or so. There were qn's about multi threading, Exception handling and collection classes. Knowledge about collections was very important for the post I was interviewed for. Huawei1
JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isThreadSafe="false". Explain it? Thanks, Seenu Huawei3
why java not supproting multiple inheritance?  5
what is main purpose of interface? Accenture2
What is I/O Filter? TCS1
wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA IBM10
What is the purpose of the File class?  2
Define interface?  2
wahts is mean by thread? HCL14
what is java  9
Are nested try statements are possible?  2
How to call static method? Epoch3
what is abstract method with example? Virtusa5
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com