-
Notifications
You must be signed in to change notification settings - Fork 0
/
alphaboss.java
67 lines (50 loc) · 1.71 KB
/
alphaboss.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import java.util.*;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
public class alphaboss extends methodTest {
public static void main(String[] args) {
//instantiating a record class
Person obj= new Person(9,"Ade");
System.out.println(obj.age());
System.out.println(obj.name());
//instance of a class C that implements an interface A
C map= new C();
map.tar();
//creating a multidimentional Array
int [][] s=new int[5][7];
s[0][0] = 4;
s[0][1] =7;
System.out.println(Arrays.deepToString(s));
//instance of a class
soutTest1 obj=new soutTest1(24,"my","name","is");
System.out.println(obj.x);
int i=0;
myMethod1(i);
//methodTest test=new soutTest1();
//test.myMethod2();
//creating a list of lists and accessing it wit a for loop
int [] list={7,9,0,6};
List<List<String>> a=List.of(List.of("4","8","6"), List.of("0","23","56"), List.of("78","87","67"));
String found=null;
boy: for (List<String> x : a){
System.out.println();
System.out.println();
for (String v :x){
System.out.print(v + ",");
if (v.contains("3")){
found=v;
break boy
//creating an ArrayList
ArrayList<Integer> x= new ArrayList<Integer>();
x.add(1);
x.add(2);
x.add(8);
x.add(8);
int i=0;
while (i<x.size()){
++i ;
System.out.println(x.get(0));
}
}
}