Class1 is well encapsulated if all its member variables are declared
private, so they can be accessed or changed only by method calls.
Regarding your first sample code, a child class inherits all the parent
member variables and methods that it can see; those with public,
protected and often package access. In this case, Class2 cannot see
method1() of its parent, so Class2 is free to define a similar method.
As you said, this is not an example of overriding.
Jim ...
...