I have a homework assignment and I need to evaluate which approach is better according to GRASP "Protected Variation". I found [a question on Stack Overflow about the separation of header and code files in C++][1].

However, what I want to know why Java does not follow C++ in promoting the separation between class definitions and class implementations. Are there any advantages with the Java method, over the C++ method?


  [1]: http://stackoverflow.com/questions/333889/in-c-why-have-header-files-and-cpp-files