Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f306d03

Browse files
Conclusion and Cleanup
1 parent 6b53e61 commit f306d03

File tree

6 files changed

+111
-0
lines changed

6 files changed

+111
-0
lines changed

‎Task-15/.gitignore‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
### IntelliJ IDEA ###
2+
out/
3+
!**/src/main/**/out/
4+
!**/src/test/**/out/
5+
6+
### Eclipse ###
7+
.apt_generated
8+
.classpath
9+
.factorypath
10+
.project
11+
.settings
12+
.springBeans
13+
.sts4-cache
14+
bin/
15+
!**/src/main/**/bin/
16+
!**/src/test/**/bin/
17+
18+
### NetBeans ###
19+
/nbproject/private/
20+
/nbbuild/
21+
/dist/
22+
/nbdist/
23+
/.nb-gradle/
24+
25+
### VS Code ###
26+
.vscode/
27+
28+
### Mac OS ###
29+
.DS_Store

‎Task-15/.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.

‎Task-15/.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.

‎Task-15/.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.

‎Task-15/Task-15.iml‎

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>

‎Task-15/src/Main.java‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//Exercise 15: Conclusion and Cleanup
2+
//15. Task: Go through all your code, ensure it compiles and runs correctly,
3+
// and print any final messages or observations you have made during the lab session.
4+
5+
public class Main {
6+
public static void main(String[] args) {
7+
8+
// Exercise 5: Working with Primitive Data Types
9+
byte byteContainer = 102;
10+
short shortContainer = 21;
11+
int intContainer = 1;
12+
long longContainer = 2423234293848223423L;
13+
float floatContainer = 21.2f;
14+
double doubleContainer = 2.232;
15+
char charContainer = 'f';
16+
boolean booleanContainer = true;
17+
18+
System.out.println("Byte value: " + byteContainer);
19+
System.out.println("Short value: " + shortContainer);
20+
System.out.println("Int value: " + intContainer);
21+
System.out.println("Long value: " + longContainer);
22+
System.out.println("Float value: " + floatContainer);
23+
System.out.println("Double value: " + doubleContainer);
24+
System.out.println("Char value: " + charContainer);
25+
System.out.println("Boolean value: " + booleanContainer);
26+
27+
// Exercise 12: Basic Conditional Logic (if-else)
28+
int number = 5;
29+
if (number > 10) {
30+
System.out.println("Number is greater than 10");
31+
} else {
32+
System.out.println("Number is less than or equal to 10.");
33+
}
34+
35+
// Exercise 13: Using Ternary Operator
36+
boolean isAvailable = false;
37+
boolean available = isAvailable ? true : false;
38+
System.out.println("Availability: " + available);
39+
40+
// Exercise 14: Exploring Strings
41+
String originalMessage = "Hello";
42+
System.out.println("Initial String: " + originalMessage);
43+
String modifiedMessage = "World";
44+
System.out.println("Modified String: " + modifiedMessage);
45+
46+
// Conclusion and Final Observations
47+
System.out.println("--- Final Observations ---");
48+
System.out.println("1. I have successfully demonstrated the use of different data types in Java.");
49+
System.out.println("2. The if-else statement works effectively for basic conditional logic.");
50+
System.out.println("3. The ternary operator provides a concise way to evaluate conditions.");
51+
System.out.println("4. I observed that strings in Java are immutable, as shown in the string exploration exercise.");
52+
System.out.println("5. Overall, the exercises reinforced my understanding of fundamental Java concepts.");
53+
}
54+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /