This project focuses on the String class in Java. It demonstrates how to declare a variable of an object type, initialize it with a string literal containing a message "from the future", and print the stored character sequence to the console.
- Declare a
Stringvariable namedfutureMessage. - Assign it the legendary phrase:
"Good news everyone!". - Display this message on the screen.
After running the program, the console should display:
Good news everyone!
- Language: Java 23
- IDE: IntelliJ IDEA
- Concepts: Object types (String), Object-oriented basics, Console output.
The code uses the String class, which acts as an object container for text. Unlike primitive types (like int), it stores data in a structured way and provides built-in tools for data manipulation.
A simple and effective implementation of receiving a message from the future :)
package com.yurii.pavlenko;
public class Task_12_App {
public static void main(String[] args) {
// Receiving a message from the future
String futureMessage = "Good news everyone!";
// Printing to the console
System.out.println(futureMessage);
}
}This project is licensed under the MIT License.
Copyright (c) 2026 Yurii Pavlenko
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...
License: MIT