Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 9:39 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: Question problem
PostPosted: Thu May 05, 2011 8:05 am 
Offline
Newbie
User avatar

Joined: Wed May 04, 2011 11:54 am
Posts: 1
Has thanked: 0 time
Have thanks: 0 time

Write a java program asking the user to read two arrays as set of maximum 10 integer values and print the union of these two sets.



Plz give me fast answar as soon as posibel.......plz plz plz,,,,,,,,


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Question problem
PostPosted: Thu May 05, 2011 6:43 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
this code snippet should help .
Code:

        
// scanner to read user input.
        
Scanner myscan = new Scanner(System.in);
        List<
IntegerarrayList = new ArrayList<Integer>();
        
// First array list .
        
for(int i=0;i<10;i++){
        
int newvalue =myscan.nextInt();

           if(
arrayList.indexOf(newvalue)==-1){
         
// newvalue is not in array .
               
arrayList.add(newvalue);
          }
        }
 

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 need answer to the following question
 JavaScript fade out problem
 problem with JcheckBox method
 client server problem
 problem
 Question I hope to be answered
 Matlab SVM training problem
 I have a serious virus/trojan problem, anyone pls?
 i have problem
 Windows problem!!!

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team