A class is basically a definition, and contains the object's code. An object is an instance of a class
for example if you say
String word = new String();
the class is the String class, which describes the object (instance) word.
When a class is declared, no memory is allocated so class is just a template.
When the object of the class is declared, memory is allocated.