Using the new class method: The new class method will create an empty hash, which means the hash will have no default value. hash variable = Hash.new is the syntax.
Using braces: In this hash variable, = and curly braces are used. The key/value pairs are constructed between curly braces.
Share a personalized message with your friends.