Skip to content

Commit d3c92c5

Browse files
committed
Migrate development environment from Windows to macOS and continue project updates
- Shifted primary development environment from Windows to macOS to ensure better performance, stability, and streamlined workflow for Java development. - Removed OS-specific metadata and ensured platform-agnostic project compatibility. - Normalized line endings to LF for cross-platform consistency. - Verified and adjusted file paths, permissions, and encoding settings to suit macOS environment. - Cleaned up unnecessary Windows-generated files and updated Git configuration accordingly. - Future commits and development will now be managed entirely from macOS. This migration ensures a cleaner, more consistent setup moving forward and prepares the project for scalable development across Unix-based systems. Future development will continue on macOS for a smoother, Unix-based experience. Signed-off-by: Someshdiwan <[email protected]>
1 parent 7618068 commit d3c92c5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.util.Optional; // Import the Optional class
2+
3+
public class OptionalExample {
4+
public static void main(String[] args) {
5+
// 1. Create an Optional containing the string "hello"
6+
Optional<String> optional = Optional.of("hello");
7+
8+
// 2. Transform the value inside the Optional to uppercase ("HELLO")
9+
String result = optional
10+
.map(String::toUpperCase)
11+
// 3. Filter the value - check if it starts with "H". "HELLO" starts with "H", so the Optional remains present.
12+
.filter(s -> s.startsWith("H"))
13+
// 4. If the Optional was empty, return "world". It's not empty, so return the value inside ("HELLO").
14+
.orElse("world");
15+
16+
// 5. Print the final result
17+
System.out.println(result);
18+
}
19+
}

0 commit comments

Comments
 (0)