Search:

Type: Posts; User: simpson_121919

Search: Search took 0.11 seconds.

  1. Trying to understand the "protected" keyword.

    When a method has private access it can not be accessed anywhere other than its own class file. With protected I'm confused to when you can not use it because to use any method from another class you...
  2. Replies
    3
    Views
    1,095

    Re: Cannot pass variables?

    Oh, so to make the swap method work I would have to create public variable which is bad design practice?
  3. Replies
    3
    Views
    1,095

    Cannot pass variables?

    in my instance field I have variables a = 1 and b = 2. I can not seem to pass "a" and "b" through my swap method as a parameter. I am confused to why.


    public void swap(int i1, int i2)
    ...
  4. Re: "cannot find symbol" error when trying to use the getInt() method.

    It turns out it is an ArrayType Class. I have so much to learn. Thanks for the help.
  5. Re: "cannot find symbol" error when trying to use the getInt() method.

    Oh I was mistaken the Array class for the Arrays class. After looking into the arrays class I tried doing a binarySearch() and got the same error. All I was trying to do was access info from an...
  6. Re: "cannot find symbol" error when trying to use the getInt() method.

    Sorry - "cannot find symbol - method getInt(int[],int)"
    I'm trying to write a method that will allow me to access the hourCounts array.
  7. "cannot find symbol" error when trying to use the getInt() method.

    I am trying to obtain something from an array and when I compile it tells me "cannot find symbol. "


    public int numberOfAccesses()
    {
    int total = 0;
    int index = 0;
    ...
  8. Re: Trouble with while loop and the use of the Iteration class.

    Oh I see what you're saying. By invoking the next method again I am using next item instead of the intended one that didn't get referenced because I am chaining when I shouldn't be.

    I am...
  9. Re: Trouble with while loop and the use of the Iteration class.

    yes I was hoping to return the record with id=2. I redid the method just using a variable instead of an Iterator object.



    public Product findProduct(int id)
    {
    int index = 0;
    ...
  10. Re: Trouble with while loop and the use of the Iteration class.

    The searchID holds the the ID field instance in the Product class. It retrieves it through getID method located in the Products class. The ID == searchId is to test and see if the parameter passed...
  11. Trouble with while loop and the use of the Iteration class.

    I am having a hard time with using the Iteration class. I don't know how to effectively use the "next()" method, it confuses me. When I search for the last product in the list nothing prints out...
Results 1 to 11 of 11