-
Notifications
You must be signed in to change notification settings - Fork 3
/
programs.java
114 lines (77 loc) · 2.25 KB
/
programs.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
public class MathTest {
//https://prnt.sc/zfbdivs7G2AC
//https://www.onlinegdb.com/online_java_compiler
public static void main(String[] args) {
int x = (10*10)-10;
System.out.println(x);
}
}
stale eror.
Set<itrator> wondows = driver.getWindowHandlers();
Input Array = {2,7,0,9,0,6,5,4,0,1,0}
Output = {2,7,9,6,5,4,1,0,0,0,0}
*************************************
public class Main
{
public static void main(String[] args) {
int[] Array = {2,7,0,9,0,6,5,4,0,1,0,0};
for(int i=0; i<Array.length-1; i++){
if(Array[i] != 0){
System.out.print(Array[i]);
}else if (Array[i] ==0 && Array[i+1]==0) {
System.out.print(Array[i]);
}
if(i == Array.length) {
break;
}
}
******************************
=================================
class First {
int i = 10;
public First(int j) {
System.out.println(i);
this.i = j * 10;
}
}
class Second extends First {
public Second(int j) {
super(j);
System.out.println(i);
this.i = j * 20;
}
}
public class MainClass {
public static void main(String[] args) {
Second n = new Second(20);
System.out.println(n.i);
}
}
============================================
class First {
public First() {
System.out.println("a");
}
}
class Second extends First {
public Second() {
System.out.println("b");
}
}
class Third extends Second {
public Third() {
System.out.println("c");
}
}
public class MainClass {
public static void main(String[] args) {
Third c = new Third();
}
}
=============================
public class MathTest {
public void main(String[] args) {
int x = 10*10-10;
System.out.println(x);
}
}