Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. package calculatempo;
  7. import java.util.ArrayList;
  8. import java.util.Iterator;
  9.  
  10. /**
  11. *
  12. * @author Gilson
  13. */
  14. public class Teste {
  15.  
  16. private int i;
  17. private ArrayList arrayList = new ArrayList();
  18. private static final int TAM = 3000000;
  19. int array[] = new int[TAM];
  20.  
  21.  
  22. public Teste(){
  23. }
  24.  
  25.  
  26. public void fulfillArrayList(){
  27. for (i=0; i< TAM; i++){
  28. arrayList.add(i);
  29. }
  30. }
  31.  
  32. public void fulfillArray() {
  33. for (i = 0; i < TAM; i++) {
  34. array[i] = i;
  35. }
  36. }
  37.  
  38. public boolean searchArrayList(int info) {
  39. return arrayList.contains(info);
  40. }
  41.  
  42. public boolean searchArray(int info){
  43. for (i = 0; i < TAM; i++){
  44. if (array[i] == info){
  45. return true;
  46. }
  47. }
  48. return false;
  49. }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement