Search:

Type: Posts; User: Markusovich_

Page 1 of 2 1 2

Search: Search took 0.10 seconds; generated 5 minute(s) ago.

  1. Replies
    1
    Views
    774

    Polymorphism

    My computeCommission is not working because I keep getting 0.0 instead of the actual commission value



    package lab4;

    public abstract class Policy {

    public double commission;
  2. How can I fix the spacing on my output?

    I want my output to look like example1, but instead it looks like example2.
  3. How can I read a file and store it's objects into my custom linked list?

    Basically, I am not using any of the Java API classes such as ArrayLists or LinkedLists, as I have created my own custom linked list class which in this case is named FoodList. I am trying to figure...
  4. Re: How can I remove an integer from a random number generator?

    How?

    --- Update ---

    What does shuffling have to do with removing an int from the generator?
  5. Re: How can I remove an integer from a random number generator?

    It worked. However, I still can't remove the random integer from the generator.

    --- Update ---

    Please run this code


    package teacher;

    public class Driver {
  6. Re: How can I remove an integer from a random number generator?

    I've tried to make an arraylist and add all possible integers, but my code gives me an error:


    ArrayList<Integer> x = new ArrayList<Integer>();
    x.add(0);
    x.add(1);
    x.add(2);
    x.add(3);...
  7. How can I remove an integer from a random number generator?

    If a randomly generated number is called once, how can I exclude it so it isn't called next time?

    Please run my code:


    package teacher;

    public class Driver {

    public static void...
  8. Replies
    12
    Views
    1,130

    Re: Removing an object from an ArrayList

    I replaced



    public boolean equals(Player other){
    return(true);
    }


    with
  9. Replies
    12
    Views
    1,130

    Re: Removing an object from an ArrayList

    I think I got it now, thanks!

    I created my equals method like this:


    public boolean equals(Player other){
    return(true);
    }

    Now it works perfectly fine.
  10. Replies
    12
    Views
    1,130

    Re: Removing an object from an ArrayList

    How does the get method return a reference to an object in the list?

    I created an equals method in the Player class but have not used it.

    --- Update ---

    This is my method when I added the...
  11. Replies
    12
    Views
    1,130

    Re: Removing an object from an ArrayList

    And how can I reference an object that is already in the ArrayList?
  12. Replies
    12
    Views
    1,130

    Re: Removing an object from an ArrayList

    Because there is no other way that I know of to delete an object. Is there an alternative to remove()?
  13. Replies
    12
    Views
    1,130

    Re: Removing an object from an ArrayList

    I'm already using the correct method to delete the certain object though. I don't need a boolean because I already know that it doesn't work
  14. Replies
    12
    Views
    1,130

    Removing an object from an ArrayList

    How can I remove an object from an ArrayList? If you run my code, my delete method in the Team class does not seem to be able to remove the object that I typed from the keyboard.

    the remove()...
  15. Re: Trying to read objects from file into ArrayList

    That's the problem, it does not read the next two lines. It only reads the first line, and I want to get it to read ALL of the lines in the file. And put all of those objects into an ArrayList, so...
  16. Re: Trying to read objects from file into ArrayList

    I did

    This is my output:

    details=[Simon, Markus, 0, 0, 0]
    details=[]
  17. Re: Trying to read objects from file into ArrayList

    I fixed the code to say 4 elements instead of 5.

    This line only returns the first object I have in the file:



    System.out.println("details="+ java.util.Arrays.toString(details));


    Does...
  18. Re: Trying to read objects from file into ArrayList

    If you look at line 95, I made the size of the array to hold 5 elements.

    String[] details = new String[4];
  19. Trying to read objects from file into ArrayList

    I am working on my own personal project where you keep a record of Player objects in a file. I have created a way create a new file and add Player objects to it, or open an existing file and add...
  20. soft selection for student object test scores

    utjd
  21. Replies
    8
    Views
    791

    Re: Inheritance problem

    .
  22. Replies
    8
    Views
    791

    Re: Inheritance problem

    .
  23. Replies
    8
    Views
    791

    Re: Inheritance problem

    .
  24. Replies
    8
    Views
    791

    Inheritance problem

    .
  25. return statements kicking me out of do-while loop

    dsgwehfdsbrsfdnfgdsnb
Results 1 to 25 of 27
Page 1 of 2 1 2