1.

How Do You Test A "protected" Method?

Answer»

When a method is declared as "protected", it can only be accessed within the same package where the class is defined. HENCE to TEST a "protected" method of a target class, DEFINE your test class in the same package as the target class.

When a method is declared as "protected", it can only be accessed within the same package where the class is defined. Hence to test a "protected" method of a target class, define your test class in the same package as the target class.



Discussion

No Comment Found