Help with collision between two array objects

Thank you for your response! I know that tutorial has helped me countless times in the past, but I can’t figure out exactly what I’m doing wrong this time. From the previous post, I changed the meteor file to a circle to make it easier. I also commented out the code I was using for the collision (it said that I wasn’t using global variables). I applied your method under the “Collision Detection between Many Objects” to the best of my knowledge. If you could let me know where I went wrong, that would be great!

//outer space stars array
Meteor[] meteor = new Meteor[10];
ArrayList bullets;

//variables
float rectX = 300;
int rectY = 760;
int bulletY = 750;
float positionChange = 1.5;
int speed = 1;
int meteorW = 90;
int bulletChange = 3;
int meteorXMin = 50;
int meteorXMax = 550;
int spaceshipW = 80;
int bulletWidth = 15;
int bulletHeight = 15;
int bulletYStart = 730;

void setup() {
size(600, 800);

//meteors
for(int i = 0; i < meteor.length; i++) {
meteor[i] = new Meteor(random(meteorXMin, meteorXMax), random(-height), meteorW);

//bullets
bullets = new ArrayList();
bullets.add(new Bullet(width/2, 0, bulletWidth, bulletHeight));
}
}

void draw() {
background(0);

//meteor objects
for(int i = 0; i < meteor.length; i++) {
meteor[i].drawTheMeteors();
meteor[i].moveTheMeteors();
meteor[i].wrapTheMeteors();
}

//load the spaceship
rectMode(CENTER);
rect(rectX, rectY, 100, 50);
if(key == CODED) {
if(keyCode == LEFT) {
rectX = rectX - positionChange;
}
if(keyCode == RIGHT) {
rectX = rectX + positionChange;
}
}

//spaceship wrapping
if(rectX + 50 < 0) {
rectX = width + spaceshipW / 2;
}
if(rectX - 50 > width) {
rectX = -spaceshipW / 2;
}

//bullet objects
for (int i = bullets.size()-1; i >= 0; i–) {
Bullet bullet = bullets.get(i);
bullet.moveTheBullets();
bullet.displayTheBullets();
}

//collision detection
//if(dist(meteor.x, meteor.y, bullets.x, bullets.y) < 100) {
// meteor.x = 1000;
//}
}

void mousePressed() {
bullets.add(new Bullet(rectX, bulletYStart, bulletWidth, bulletHeight));
}

class Bullet {
float x;
float y;
float speed;
float w;
float h;
float life = 255;

public Bullet(float x, float y, float w, float h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
speed = 3;
}

void moveTheBullets() {
y = y - speed;
}

void displayTheBullets() {
fill(255, 0, 0);
ellipse(x, y, w, h);
}
}

class Meteor {
float x;
float y;
float d;
float speed = 1;

public Meteor(float x, float y, float d) {
this.x = x;
this.y = y;
this.d = d;
}

void drawTheMeteors() {
ellipse(x, y, d, d);
}

void moveTheMeteors() {
y = y + speed;
}

void wrapTheMeteors() {
if(y - 50 > height) {
y = -50;
}
}
}