Search:

Type: Posts; User: jean28

Page 1 of 3 1 2 3

Search: Search took 0.22 seconds.

  1. Replies
    5
    Views
    197

    Re: Adding polynomials in an ArrayList?

    It is okay. I already got it :)


    @Override
    public Polynomial add(Polynomial P2)
    {
    PolynomialImp P3 = new PolynomialImp();

    for(Term t: P2)
    {
  2. Replies
    5
    Views
    197

    Re: Adding polynomials in an ArrayList?

    I did that loop that you wrote here:


    for(int i = 0; i <= this.terms.size() - 1; i++)
    {
    if(this.terms.get(i).getExponent() >= 0)
    {
    P3.addTerm(new...
  3. Replies
    5
    Views
    197

    Adding polynomials in an ArrayList?

    I have an ArrayList terms with various polynomial terms inside. This is what is inside:



    So there are 4 elements inside the array. Each one has their own coefficient and exponent.

    I want to...
  4. Replies
    1
    Views
    162

    Implementing a good .equals method?

    I am making a programming project that implements terms for polynomials. For example, if I put "7x^3+4x^2", then the class has an inner array list that stores "7x^3" and "4x^2". However, I need to...
  5. Replies
    1
    Views
    108

    ArrayList remove() implementation problem?

    Hey guys I wanted to know if someone could tell me what I'm doing wrong here. I need to implement the methods of an ArrayList, and I was doing great until I had to implement the remove() method.
    ...
  6. Accessing the location manager of a device?

    Hey guys. I've searched everywhere trying to make a small application that returns my current localization. Ideally I would like to see it in Google maps, but latitude and longitude would do. I have...
  7. Re: Array that tests if any elements repeat themselves

    I think that this one should work, but for some reason it doesn't. Does anything clear seem wrong now again?


    public static boolean isDifferent(float[] array)
    {
    float temp;
    boolean count...
  8. Re: Array that tests if any elements repeat themselves

    I tried to do another for loop but this one always gives me false (reasonable, considering that if I loops through it I will always find the value that I stored in temp. How do I fix this?
  9. Re: Array that tests if any elements repeat themselves

    I put array.length - 2 and it worked :) thanks.
  10. Array that tests if any elements repeat themselves

    Hey guys, I am trying to write a program that takes an array of float values and determines if all the numbers are different for each other. I am trying to set a temp variable that stores the value...
  11. Replies
    6
    Views
    184

    Re: For vs. For Each loops?

    In my class the professor was showing us a "Bag" program that he was writing and it was a collection. He told us that a way to be able to iterate the Bag program was to put a subclass called...
  12. Replies
    6
    Views
    184

    Re: For vs. For Each loops?

    So I will always need to implement the iterator interface if I am making my own collection?
  13. Replies
    6
    Views
    184

    For vs. For Each loops?

    I am a bit new to for each loops and I'm trying to understand what are the main differences between them when working with arrays. Is there any particular set where the for each is more convenient?...
  14. Replies
    1
    Views
    145

    How to export a Java program?

    How can I make a java program that is an .exe file that runs without opening Eclipse? Does anybody know?

    Thanks very much.
  15. Replies
    3
    Views
    263

    Help creating an AVD

    Hey guys. I am new to Android and I was trying to make a new AVD in eclipse but for some reason the program wont let me do it. I have already installed countless Android SDK's (from 3.0 to 4.2) but...
  16. Thread: finally clause

    by jean28
    Replies
    2
    Views
    225

    Re: finally clause

    What about that variable "reader" ? What can I do with it?
  17. Replies
    1
    Views
    164

    Abstract Classes?

    Could anyone explain to me the use of an abstract class and why I would prefer them over an interface?

    As far as I understand, both contain empty method declarations, except that you can implement...
  18. Thread: finally clause

    by jean28
    Replies
    2
    Views
    225

    finally clause

    Hey guys, I have a few doubts about the finally clause in exception handling.

    What exactly does it do? Does it need to have try and catch blocks before it in order to work?

    I just can't seem...
  19. Re: Instance Variable does't work in extended class?

    Thanks a lot guys, for some reason the program ran just fine after I saved it for some reason...
  20. Instance Variable does't work in extended class?

    Hey guys, I have a super class and a class that extends it. For some reason, the variable cur doesn't work in the extended class even though it should work just fine. The errors are in the...
  21. Replies
    2
    Views
    154

    Re: The += assignment operator?

    Thank you very much!
  22. Replies
    2
    Views
    154

    The += assignment operator?

    Hey guys I have a quick question. Could anyone explain to me what the += does and how it works? I have seen it in different examples that use arrays but I still don't get what it's supposed to do.
    ...
  23. Replies
    7
    Views
    148

    Re: How to use a Random object here?

    I found this example online that looks dangerously similar to what I am trying to do, but to a much simpler extent:



    private static String person() {
    String name;
    switch...
  24. Replies
    7
    Views
    148

    Re: How to use a Random object here?

    I saw that in order to get 3 random variables I need to set the nextInt to 2 so that I get a 3 possible numbers: 0,1, and 2. That is why I put 2 inside the nextInt that gets the random objects from...
  25. Replies
    7
    Views
    148

    Re: How to use a Random object here?

    Ok, I will try to do a more specific description here.

    When I run this code:



    asteroids.get(i).translate(0, asteroids.get(i).getSpeed());
    // Displays one asteroid on the screen:...
Results 1 to 25 of 65
Page 1 of 3 1 2 3