Skip to content
Advertisement

Tag: methods

How do i pass variables into methods – java [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I need to use a variable from one method in another. Here is the code: Here is where it needs to be used: my current

Find all matching elements in Array – Java

At the moment my code is only giving me the first matching result. The user inputs their desired room price and at the moment it will only display the first match. In the case the user inputs ’60’ to the console it should display 3 results. I imagine i’ll need another forloop and if statement after it prints to the

Java Exercise: I’m not sure what I’m doing wrong and all help is appreciated

I am working with the following pieces of code and I keep getting this error message: Error: Main method not found in class Team, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application. All suggestions, opinions, and changes are welcome as I am completely lost on why this isn’t working.

Java class and methods returning wrong value

I am writing code in java to simulate entering a circus at a very low level code wise. It is just a couple of classes under a main class, Customer. My code is just the main class and its methods, then some print statements, My admitted method is returning false for all values when it should return true if they

Storing methods identifiably in Java

I’m trying to come up with a solution to a problem where I want to store method references in some way so that I can invoke them when needed and remove them when I don’t need them on my list of methods. The underlying goal here goes something like this: I have a Person class: I make 2 instances of

Advertisement