Skip to content

Commit 44c910b

Browse files
committed
Added first Java IntelliJ app
1 parent 5ac867a commit 44c910b

File tree

7 files changed

+63
-0
lines changed

7 files changed

+63
-0
lines changed

Lecture 1/code/FirstIntelliJApp/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lecture 1/code/FirstIntelliJApp/.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lecture 1/code/FirstIntelliJApp/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Run first project with terminal only
2+
In order to execute that next lines, you need only JDK installed. To install JDK you can run the following commands:
3+
4+
Mac:
5+
```
6+
brew install openjdk
7+
```
8+
Windows
9+
```
10+
choco install openjdk
11+
```
12+
The next command will compile the code:
13+
```
14+
javac FirstApp.java
15+
```
16+
This command will will generate the second file: FirstApp.class:
17+
```
18+
java FirstApp
19+
```
20+
The compilation is the process conversing the .java to bytecode. The next command will execute the code. On the terminal you should see: "Hello world" get printed.
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import java.util.Scanner;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
Scanner scaner = new Scanner(System.in);
6+
7+
System.out.print("Enter vehicle type: ");
8+
String vehicle = scaner.next();
9+
System.out.print("Enter vehicle year: ");
10+
int year = scaner.nextInt();
11+
System.out.print("no new line.");
12+
System.out.println(String.format("Hello Gorublqne! Az sym %s! Ot %d", vehicle, year));
13+
System.out.println("with new line.");
14+
}
15+
}

0 commit comments

Comments
 (0)