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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
How will you convert an ArrayList to Arrays?
 Question Submitted By :: Maria
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How will you convert an ArrayList to Arrays?
Answer
# 1
Using toArray() method for example

ArrayList arr_obj=new ArrayList()
arr_obj.add("viki");
arr_obj.add("siva");

Object[] obj=arr_obj.toArray();

for further Detail go to my website : 
http://www.beexpert.co.in/
 
Is This Answer Correct ?    7 Yes 0 No
Vikneswarank
[Jadian]
 
  Re: How will you convert an ArrayList to Arrays?
Answer
# 2
Using toArray() method for example

ArrayList arr_obj=new ArrayList()
arr_obj.add("viki");
arr_obj.add("siva");

Object[] obj=arr_obj.toArray();

for further Detail go to my website : 
http://www.beexpert.co.in/
 
Is This Answer Correct ?    3 Yes 0 No
Tapan Kumar Kundu
 
 
 
  Re: How will you convert an ArrayList to Arrays?
Answer
# 3
using toArray() method.
example:

ArrayList<Integer> al = new ArrayList<Integer>();
al.add(1);
al.add(5);
al.add(8);
al.add(10);

//Get the array
Integer tempArray = new Integer[al.size()];
tempArray = al.toArray(tempArray);
 
Is This Answer Correct ?    2 Yes 0 No
Vikas
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
what is the Yield() method used in threads? Accenture2
what is dynamic method dispatch ? Fidelity11
heavy components means what?  4
What is a default package ?  7
Why do we use public static with the main function in Java? Infosys7
How does serialization work Ordain-Solutions2
define System.out.println(); what is the meaning!  8
How can we find size of the object ? RazorSight1
AWT event listeners extends what interface?  1
What is the diff. b/w Interfaces & Abstract class? Ericsson4
whats string ? HCL8
write a class to input 2 points by the user & check the line maked by the points is horizontal,vertical or rectangle?  1
what is difference between front controller and action servlet?  2
Same common question what is Map,Set,HashMap,List???? Symphony3
what is request dispatcher and how does it work? CTS1
What is a native method?  2
We can write any Java Logics in our JSP. Then why we are using servlets(Controller Layer) to interact with the DAO ? TCS2
Difference between Interface & Abstract class?  4
what is a package?  8
What is the use join() in Threads ? HCL4
 
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