package kotlin.jvm.internal;

import java.util.Iterator;
import java.util.NoSuchElementException;

/* loaded from: classes3.dex */
final class b implements Iterator, en.a {

    /* renamed from: p, reason: collision with root package name */
    private final Object[] f26177p;

    /* renamed from: q, reason: collision with root package name */
    private int f26178q;

    public b(Object[] array) {
        t.g(array, "array");
        this.f26177p = array;
    }

    @Override // java.util.Iterator
    public boolean hasNext() {
        return this.f26178q < this.f26177p.length;
    }

    @Override // java.util.Iterator
    public Object next() {
        try {
            Object[] objArr = this.f26177p;
            int i10 = this.f26178q;
            this.f26178q = i10 + 1;
            return objArr[i10];
        } catch (ArrayIndexOutOfBoundsException e10) {
            this.f26178q--;
            throw new NoSuchElementException(e10.getMessage());
        }
    }

    @Override // java.util.Iterator
    public void remove() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }
}
