Skip to content
Advertisement

Tag: class

“grade” cannot be resolved to a variable

I have this exercise and the question is how can I solve the error “grade” cannot be resolved to a variable, without declare it in the class teacher. I suppose is the only error in my code. It is evident for me WHY then in my output only the grade variable is not assigned, but I don’t know HOW to

Parameter to pass in for type Class

I am trying to make a generic Stack class as shown but am unsure of what to put in for type when instantiating since I thought of doing however I get the following error of so I thought of using but I am unsure of what to put inside of cast() since it won’t take now I am stuck. Answer

Compare two objects excluding some fields – Java

I need to compare two objects of the same class excluding some fields. How can i find if the two objects of the above class are equal excluding createdAt and updatedAt values? Since there are a lot of fields in this class, i don’t want to compare each of them one by one. Please don’t give AssertJ’s recursive comparison solution

Call method in Fragment from some class

I’ve been working on Android App in AndroidStudio. Application has Fragment, let’s call it MainFragment, and seperate Java Class file, let’s call it SQLiteControler.class The problem is when i try to call method from Fragment in SQLiteController im getting null object reference as error Here is some minified code: MainFragment SQLiteController Note: This is minified code I have tried, a

Advertisement