Skip to content

Tag: java

Printing String Attribute Inherited from SuperClass shows Null

I am extending a class and using the super keyword to in my subclass constructors. However, when I attempt to print the inherited attribute String. It returns null } So when I create a TrueFalseQuestion object and call its getQuestion() method, I get output: null True/False? Why is it not printing the questio…

How to send headers from controller into another class in Java

I have a controller like below SubmitBatchController.java BatchSubmissionRequestModel.java HeaderRequestModel.java Now I have another class, which has to take the headers from SubmitBatchController.java & set it into FullEligibilityService.java FullEligibilityRequestModel.java FullEligibilityService.java …

Generics code not working when i try to return concrete object

The goal i am trying to achieve, is to have different FileLoaders like CSVFileLoader, ExcelFileLoader that can load up any object of type T, as long as it know how to convert using ‘C’ and create the object of type T. Hope this makes sense. I am trying to use generics to create a generic FileLoade…