Interviewer And Interviewee Guide

JUnit Interview Question:

How Do You Test a protected Method?

Submitted by: Administrator
When a method is declared as "protected", it can only be accessed within the same package where the class is defined.

In order to test a "protected" method of a target class, you need to define your test class in the same package as the target class.
Submitted by: Administrator

Read Online JUnit Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.