Search:

Type: Posts; User: J05HYYY

Search: Search took 0.30 seconds.

  1. Re: What can I use instead of instance variables in a servlet?

    I've been playing around with it and seems to work fine. I have never written more than one class before but it was pretty straight forward.

    I saved this as MyClass.java and compiled it into...
  2. Re: What can I use instead of instance variables in a servlet?

    Hmm these POJO's seem complicated. I'm not so good with OOP as it is. Could I request some code on how to do this, or is that asking a little too much? ^:)^

    [Maybe I would be better asking about...
  3. Re: What can I use instead of instance variables in a servlet?

    Okay, say I have the code below ...

    randomMethod can change instance variables "count" and "randomstr". Which is what I'm after.

    But my problem is that because they are instance variables, all...
  4. Re: What can I use instead of instance variables in a servlet?

    Yeah, I tested the code. Also, it's example 3.1 from here.

    With instance variables, all requests share one variable whereas with local variables it's on a per-thread basis... but what if I want my...
  5. What can I use instead of instance variables in a servlet?

    Hello, I have a program I want to convert into a servlet. When I use an instance variable; "count" in this case, it is one variable for many users and it does not reset to 0 each time the servlet is...
  6. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    No, you didn't miss something...

    ArrayList<String> valuesDuo = new ArrayList<String>(values);

    Means, I think that it creates a new instance so it doesn't change the original. Anywhoo I tested...
  7. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    Okay, I have tested the code I gave earlier and found that it works ie. it doesn't change the original ArrayList.


    ArrayList<Integer> vlinefreq = new ArrayList<Integer>();
    ArrayList<Integer>...
  8. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    Interesting. Maybe the code I just gave didn't work. I have just tried something only slightly more complex and it didn't work:


    ArrayList<Integer> vtemplinenum = new ArrayList<Integer>();...
  9. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    Yeah, in that case I need a deep copy.

    Meh, no need to use clone but still a pain to cycle through every element.



    vlinefreq.clear();
    int x;
    for (x=0; x < vfrequency.get(s).size(); x++)
    {
  10. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    One more last thing :P ... how do I copy an ArrayList? I tried this:


    vlinefreq = vfrequency.get(s);

    but it doesn't seem to work as I imagined it to.
  11. Re: error: This method must return a result of type int

    Thanks...

    So is "(!foundResponse)" the same as "(foundResopnse == false)"?
  12. error: This method must return a result of type int

    Hello, I am getting this error with my code "error: This method must return a result of type int" haven't a clue why it's happening.

    int processresponse(String response){
    int a;
    Boolean...
  13. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    Cheers - answered my questions exactly.
  14. Replies
    14
    Views
    6,848

    Re: How to use this 2d ArrayList class?

    Thank you. This is what I needed. :)

    ... one last thing, how would I go about reassigning a new value to an existing element?
  15. Replies
    14
    Views
    6,848

    How to use this 2d ArrayList class?

    Hello,

    I am new to java, these forums and know very little about object orientated programming.
    I am trying to convert a C++ program to java which uses 2 dimentional vectors.
    Searching google I...
Results 1 to 15 of 15