Skip to content

Commit 80a36a8

Browse files
committed
Java Basic - SQL Session
1 parent c65fb14 commit 80a36a8

File tree

2 files changed

+177
-27
lines changed

2 files changed

+177
-27
lines changed

Diff for: java-path-core-basic/pom.xml

+12
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,16 @@
1818
<name>[${project.artifactId}]</name>
1919
<description>Java Learning @ Development Path, Core module, Basic Java demonstration</description>
2020

21+
<dependencies>
22+
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
23+
<dependency>
24+
<groupId>com.h2database</groupId>
25+
<artifactId>h2</artifactId>
26+
<version>1.4.200</version>
27+
</dependency>
28+
29+
</dependencies>
30+
31+
32+
2133
</project>
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,172 @@
11
package gr.codelearn.core.showcase.basic;
22

3+
import javax.swing.plaf.basic.BasicInternalFrameTitlePane;
4+
import java.util.Scanner;
5+
36
public class BasicJavaExamples {
7+
48
public static void main(String[] args) {
5-
boolean myVariable = true;
6-
int myInteger = 0;
7-
float myFloat = 3.14f;
8-
9-
var myVar = "hello";
10-
// myVar = 10;
11-
12-
System.out.println("Boolean variable: " + myVariable + " integerVariable: " + myInteger);
13-
14-
System.out.println("Hello " + 1 + 2);
15-
System.out.println(1 + 2 + " Hello");
16-
17-
int aVariableInteger = 10;
18-
aVariableInteger = aVariableInteger + 2;
19-
aVariableInteger -= 2;
20-
aVariableInteger++;
21-
++aVariableInteger;
22-
23-
int a = 10;
24-
int b = 20;
25-
// int c = ++a+b++;
26-
/*System.out.println(c);
27-
System.out.println(c++);
28-
System.out.println(++c);*/
29-
System.out.println(a * b);
30-
System.out.println(b / a);
31-
System.out.println(b % a);
9+
// final int MAX_NUMBER_OF_ARG = 8;
10+
// boolean myVariable = true;
11+
// int myInteger = 0;
12+
// float myFloat = 3.14f;
13+
// long l = 3l;
14+
//
15+
// var myVar = "hello";
16+
// // myVar = 10;
17+
//
18+
// System.out.println("Boolean variable: " + myVariable + " integerVariable: " + myInteger);
19+
//
20+
// System.out.println("Hello " + 1 + 2);
21+
// System.out.println(1 + 2 + " Hello");
22+
//
23+
// int aVariableInteger = 10;
24+
// aVariableInteger = aVariableInteger + 2;
25+
// aVariableInteger -= 2;
26+
// aVariableInteger++;
27+
// ++aVariableInteger;
28+
//
29+
// int a = 10;
30+
// int b = 20;
31+
// b = a++; // b = a; a = a + 1
32+
// b = ++a; // a = a + 1; b = a;
33+
//// int c = ++a+b++;
34+
// /*System.out.println(c);
35+
// System.out.println(c++);
36+
// System.out.println(++c);*/
37+
// System.out.println(a * b);
38+
// System.out.println(b / a);
39+
// System.out.println(b % a);
40+
41+
// int a = 5;
42+
// int b = 2;
43+
//
44+
// System.out.println(5.0/2);
45+
// System.out.println( (double)a / b );
46+
// System.out.println(a % b);
47+
// System.out.println(b % a);
48+
49+
// System.out.println( 60 % 60);
50+
51+
// >= <= > < == != // Relational
52+
// System.out.println(5 < 3);
53+
//
54+
// // && || ! // logical
55+
// int a = 5;
56+
// int b = 2;
57+
// System.out.println( (a < b && b > 0) );
58+
59+
// & | ! >> <<
60+
// int bits = 5;
61+
// System.out.println(bits << 2);
62+
// System.out.println(bits >> 2);
63+
64+
// int a = 5;
65+
// int b = 22;
66+
// // System.out.println( (a < b && b > 0) );
67+
//
68+
//// if (a > b){
69+
//// System.out.println(a);
70+
//// }
71+
//
72+
// if (a > b){
73+
// System.out.println(a);
74+
// } else {
75+
// System.out.println(b);
76+
// }
77+
//
78+
// // condition ? code for true : false;
79+
// System.out.println( a > b ? a : b );
80+
//
81+
//
82+
// if (a > b){
83+
// System.out.println(a);
84+
// } else if (a < b){
85+
// System.out.println(b);
86+
// } else {
87+
// System.out.println("=");
88+
// }
89+
90+
// int a = 5;
91+
// int b = 0;
92+
// if (a < b && ++b > 0){
93+
// System.out.println(a);
94+
// } else {
95+
// System.out.println(b);
96+
// }
97+
98+
// int a = 5;
99+
// switch (a){
100+
// case 3:
101+
// System.out.println("3"); break;
102+
// case 5:
103+
// System.out.println("5"); break;
104+
// case 7:
105+
// System.out.println("7"); break;
106+
// default:
107+
// System.out.println("Error...");
108+
// }
32109

110+
// String month = "Jan";
111+
// switch (month){
112+
// case "Jan":
113+
// case "Mar":
114+
// case"May": System.out.println(31); break;
115+
// case "Apr":
116+
// case "Jun":
117+
// case"Aug": System.out.println(30); break;
118+
// default:
119+
// System.out.println(27);
120+
//
121+
// }
122+
// int i = 6;
123+
// while (i < 5){
124+
// System.out.println(i);
125+
// i++;
126+
// }
127+
//
128+
// for(int j = 0; j < 5; j++){
129+
// System.out.println(j);
130+
// }
131+
//
132+
// int k=6;
133+
// do {
134+
// System.out.println(k);
135+
// k++;
136+
// } while(k < 5);
137+
138+
// Scanner in = new Scanner(System.in);
139+
// int number;
140+
// do {
141+
// System.out.print("Enter a number: ");
142+
// number = in.nextInt();
143+
// } while(number <= 0);
144+
//
145+
// int t = 0;
146+
// while(t < 400){
147+
// int l = 9;
148+
// //....
149+
// t++;
150+
// }
151+
152+
int res = sum(2,5);
153+
int res1 = sum(2,5) + 45 + sum(4,4);
154+
System.out.println(res);
155+
System.out.println(res1);
156+
System.out.println(sum(7,3));
157+
doSomething();
33158
}
159+
160+
public static int sum(int num1, int num2){
161+
// int res = num1 + num2;
162+
// return res;
163+
return num1 + num2;
164+
}
165+
166+
public static void doSomething(){
167+
System.out.println("Hello");
168+
}
169+
170+
171+
34172
}

0 commit comments

Comments
 (0)