There are following difference between ClassNotFoundException and NoClassDefFoundError:-
1) A ClassNotFoundException is thrown when Java went looking for a particular class by name and could not load successfully it. A NoClassDefFoundError is thrown when Java went looking for a class that was linked into some existing code, but couldn't find it for one reason or another and something has gone Badly Wrong.
2) ClassNotFoundException:- It occurs when class loader could not find the required class in class path.
NoClassDefFoundError:- This is thrown when at compile time the required classes are present, but at run time the classes are changed or removed or class's static initializes threw exceptions.
3) ClassNotFoundException: thrown when an application tries to load in a class through its name, but no definition for the class with the specified name could be found.
NoClassDefFoundError: thrown if the Java Virtual Machine tries to load in the definition of a class and no definition of the class could be found.