Skip to content

YuriiJavaDev/JavaBasics_Task_14

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Escaping a quote by Yurii Gagarin (JavaBasics_Task_14)

📌 Description

This project demonstrates the use of escaping characters in Java strings. It shows how to include special characters, such as double quotes, inside a String object literal without breaking the code structure.

🚀 Task requirements

  1. Create a String variable named heroQuote.
  2. Assign it the value "Poyekhali!" (including the quotes).
  3. Use quote escaping to ensure that the string is processed correctly.
  4. Display the result on the screen.

📋 Expected result

After running the program, the console should display:

"Poyekhali!"

🛠 Technical Stack

  • Language: Java 23
  • IDE: IntelliJ IDEA
  • Concepts: Escape sequences ("), Object types (String), Console output.

⌨️ Practical Implementation

To include double quotes inside a string, we use the backslash \ as an escape character. This tells the Java compiler that the following quote is part of the text data, not the end of the string object.

💻 Code Example

package com.yurii.pavlenko;

public class Task_14_App {
    public static void main(String[] args) {
        // Escaping double quotes within the string
        String heroQuote = "\"Поехали!\"";

        System.out.println(heroQuote);
    }
}

⚖️ License

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

About

This is a learning project. JavaBasics_Task_14 Demonstration of string escaping using the example of a quote from Yuri Gagarin. 160126_1223

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages