How does 'Stock stock = new Stock(“HR.S”)' lead to an output?

How does 'Stock stock = new Stock(“HR.S”)' lead to an output?

I'm extremely new to Java, and I'm trying to understand why an output of the main method of the Magic class for this code is "TT". Our professor said we don't have to understand the meaning of this method, but just answer the output.

I'm extremely new to Java, and I'm trying to understand why an output of the main method of the Magic class for this code is "TT". Our professor said we don't have to understand the meaning of this method, but just answer the output.

The code is this.

public class Magic
{
    public static void main(String[] args)
    {
        final String MSG = "Good Restaurant Seattle";
        Stock stock = new Stock("HR.S");
        double price = stock.getPrice();
        int cent = (int) Math.rint(price);
        System.out.println(MSG.substring(cent, cent+2).toUpperCase());
    }
}

I understand where it took the letters from and how all variables such as cent and price are connected, but I don't understand what "HR.S" is and how it's connected to the output.

java

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Java Core (2020) | Java for beginners | Brush up your Java Skills | Get Hired

In this video we will learn about all the major concepts that come under Java Core . The course is very carefully designed and is made with keeping simplicit...

Java File Class Tutorial | Java.io File Class in Java Example

Java File class represents the path of directories and files. It provides the methods for renaming, deleting, and obtaining the properties of file or directory.

Best Ways To Improve Skills In Java and Python Programming

Join CETPA, India's best institute for Java online training and Certification Course. Enroll now to learn Core to Advanced Java & avail 50% discount on Java Online Course with Certificate.

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners