Skip to content

Tag: class

How to update a single array using multiple instances of a class

How can I make two instances of a class, update the same array from that class? Like here, I want r1 and r2 to update same pendingOrders, so that finally the array is [‘yo’, ‘lo’]. That is not happening, the r1 and r2 are making different arrays. Answer Add the static keyword to the pendingOrders in Robot. Check this guide

Creating an object based on the interface

I have class Button in package “pl.components” and I created interface IButoon in package “pl.icomponents”. I would like to create a button based on this interface. This button only has methods that are in the interface. So, I guess when I do Then my ibutton will only be able to use setToolTip. The only problem I have to do is

How to convert a class A to class B?

I am working on a method where I’ve written the following line here: As you can see from the TrackingCategoryTransformationClient class below, this yields an error as the abstract method getErpListDataById returns Optional<AccountingObject> and not Optional<TrackingCategory> which is what the variable is expecting. I cannot change the class that is T is bounded by in the generic since other methods

Using attributes of one class in another class

I am trying to move the assertThat method from Authentication class to the BDDStyledMethod class but the current code will generate the following error “‘Creds(java.lang.String)’ in ‘steps.Authentication’ cannot be applied to ‘()'” How do i correct my code so that the assertThat method works in the BDDStyledMethod class ? Answer The problem is with the Creds method. It is not

Doubly Linked List adding null

I’m new to Java. I want to make student information system, but whenever I used the addStudent method, I get a list with null values. This is the student class for getting names telephone numbers and student ID. This is the Node class. Methods can be wrong maybe they are too complicated sorry for that. I’m trying to learn Java.

Trouble calling methods from a class/ [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 11 months ago. Improve this question

How to call ActionPerformed method from different class

I’m trying to call an actionperformed method from a file under the same package as the one I wish to call it from. I have two classes, EditSeriesPaint and MyDataVisualization. I want to call EditSeriesPaint from MyDataVisualization. This is what I’ve tried: EditSeriesPaint Class: MyDataVisualization Class: However, when I add the method to esp and go to use the color