class Greeter
def initialize(world)
@world = world.capitalize
end
def salute
puts "Hello #{@world}!"
end
end
The Greeter class
Create a new object
g = Greeter.new("world")
Output "Hello World!"
g.salute
print('Hello, World!')
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}