Search:

Type: Posts; User: 999cm999

Search: Search took 0.13 seconds.

  1. Replies
    2
    Views
    1,141

    Re: iterator help needed

    Oh....duh...sometimes you just need another pair of eyes to take a look! Thanks! :)
  2. Replies
    2
    Views
    1,141

    iterator help needed

    I have a generic linked list with an iterator(code below).



    public static void main(String[] args)
    {
    LinkedListStuff<String> myStuff = new LinkedListStuff<String>();...
  3. Replies
    3
    Views
    1,548

    Re: What the heck is wrong with my code?

    Sorry, here is the compile error:


    MyMathClass.java:29: incompatible types
    found : T
    required: double
    for (double i : myList) {
    ^
    1 error
  4. Replies
    3
    Views
    1,548

    What the heck is wrong with my code?

    Hi everyone,

    I've been working on this for days. My "program" is supposed to take an integer or double arrayList of numbers, and then calculate the standard deviation of those numbers using a...
  5. Replies
    4
    Views
    1,372

    Re: Arrays and Generics

    Ok, well I figured my other issue out myself...basically when using:


    for (T t : myList)


    I had to do this when performing math operations:
  6. Replies
    4
    Views
    1,372

    Re: Arrays and Generics

    Oh ok, that makes sense.

    I changed my for loop to use type "T"...

    once in the loop, I need to apply math operations to the data, but I can't use addition, subtraction, etc on type "T". How...
  7. Replies
    4
    Views
    1,372

    Arrays and Generics

    I'm having trouble with a generic method that can accept ArrayLists of type integer and type double.

    The program fails to compile because it says myList is of type "T" and i is of type "double".
    ...
Results 1 to 7 of 7