# Solidity explanation part II

By [Codorrr](https://paragraph.com/@codorrr) · 2022-08-29

---

Lets create a contract.

    contract Helloworld
    {
     string hello = “Hello World”;
     function sayHello() returns (string)
        {
            return hello;
        }
    }
    

The code of contract goes between curly braces. The name HelloWorld is the name of our contract. It’s not necessary that the name has to be name given to the file.

The keyword contract here can be treated similar to a class in C++/java. Where class has methods and variables so are here. Let’s see.

The string variable is like a normal OOP string variable nothing fancy. The function sayHello() is a method, which when called returns something. Inside the parenthesis, goes the parameters. Currently none, but we’ll see later what they could be. The keyword returns tells us the return type of the function. Here it is string and yes it has to mentioned in parenthesis. Inside the function body we return the hello string variable.

---

*Originally published on [Codorrr](https://paragraph.com/@codorrr/solidity-explanation-part-ii)*
