-2

I have a problem with my code. I can't resolve a problem with this :( I send screenenter image description here:

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Sebastian
  • 1,339
  • 3
  • 7
  • 6
  • 1
    In `Questions_Driving_licenece` class, the member `questions` is declared `private` and you can't access it. Make it `public`. – forpas Oct 21 '18 at 14:06
  • You should be able to access those variables by setting up Getters and Setters. – Nero Oct 21 '18 at 14:11
  • This question would be more useful if you shared the relevant parts of your source code as text. – oberlies Sep 23 '19 at 08:52

2 Answers2

1

You cannot access variables which are set private. Use getter to get the variables and then perform operations on it. Use

public String getQuestions(){ return questions; }

in the Questions_Driving_License class.

prasad bankar
  • 46
  • 1
  • 4
0

Create public getter for those fields in Questions_Driving_license class e.g.:

public String questions(){
  return this.questions;
}

And then use this getter like this:

questions_Driving_license.getQuestions().length

What is more the class should be named QuestionsDrivingLicence.

Da Artagnan
  • 1,109
  • 3
  • 17
  • 26