anoterCode
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 11s
Gitea Actions Demo / GoBuild (push) Failing after 5s

This commit is contained in:
2024-09-11 23:21:31 -04:00
parent 922420d5e2
commit c5974fe278
10 changed files with 196 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
public class Amazon {
public static void main(String[] args) {
int x = 0;
int[] ar = { 3, 4, 4, 4, 3, 3, 3, 3, 6, 6, 6, 6, 1, 1, 1, 1, 9 };
ArrayList<Integer> al = new ArrayList<>();
for(int i : ar){
al.add(ar[i]);
if(!al.contains(ar[i])){
al.add(ar[i]);
++x;
for(int j = i + 1; j < ar.length; j++){
if(ar[i] == ar[j]){
x++;
}
}
System.out.println(ar[i]);
System.out.println(x);
}
}
}
}
+21
View File
@@ -0,0 +1,21 @@
public class Construct {
int year;
String model;
String make;
public Construct() {
}
public void carMake(String make, String model, int year) {
this.model = model;
this.make = make;
this.year = year;
System.out.println("My car by " + year + " is " + make + " - " + model);
}
public static void main(String[] args) {
Construct car = new Construct();
car.carMake("Audi", "RS6", 2025);
}
}