python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
why i cannot access protected member of a class from 3 rd class in another package?
I have 3 classes
package a;
public class A {
protected void add(){}
}
package b;
import a.A;
public class B extends A {
public static void main(String[] args) {
B b=new B();
...
Daniel Baker
Votes: 0
Answers: 3
Protected variable not accessible within child class in Java
I have the following structure -
App.java -
package JohnParcellJavaBasics.AccessModifierDemo;
import JohnParcellJavaBasics.AccessModifierDemo.*;
public class App {
public static void main(String[...

Payel Senapati
Votes: 0
Answers: 1
Cannot access method 'Handle' MediatR due to its protection level .net using xunit
I want to test a handler that is protected due to the AsyncRequestHandler interface in MediatR.Here is my handler :
public sealed class AddUserDeviceCommandHandler : AsyncRequestHandler<AddUserDevi...

Ehsan Akbar
Votes: 0
Answers: 1
Java - Modify attributes of an object from a different class with protected methods
I am trying to swap cells in a board. I have the class Cell with attributes such as coordinate (position in the board). This class has the method setCoordinate as protected.
I also have the class Leve...
E S
Votes: 0
Answers: 0