Search:

Type: Posts; User: ashl7

Search: Search took 0.06 seconds.

  1. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    Hey actually it did work out...sorry the first time I tested it my program had problem in another part that I didn't notice...but now I figured out what the problem was, it works just fine :)
    thanks...
  2. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    yeah
    but I'm looking for a way to display all the elements of the array on JTextField
    like this:
    a1jTextArea.setText(a[1].toString + " " + a[2].toString+ " " +.........a[10].toString)
    which...
  3. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    tnx, but didn't quite get that: you mean like this: a1jTextArea.setText(a[1].toString);
    any idea about the other questions?
  4. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    I guess I need your help again!
    this is the code for my Rational class that I asked in the first post, which is perfectly fine :>



    public class Rational{


    private long numerator;
    ...
  5. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    hmm, thanks much...got it!
  6. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    now why does it have to be "public static" and not just public?
  7. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    no wasn't trying to implement Comparable interface...I deleted that part from my program....just want to make a regular method to compare two rationals!
  8. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    hmmm, tnx
    I'm not finished with this one yet! I will add those methods later, but it won't give me a compile error, or run error later if I don't add them right?
    also, I made this method for...
  9. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    Hi...been a while, but I was working on my code, and learned some new stuff!!
    I've wrote this code so far:



    public class Rational extends Number implements Comparable<Rational>{


    ...
  10. Replies
    23
    Views
    1,741

    Re: Working with methods and constructors

    um I know why it's not a value, cuz it's a reference variable! that's not what my question is about, I'm more asking for a solution to get a rational number by calling a constructor Rational!
    I have...
  11. Replies
    23
    Views
    1,741

    Working with methods and constructors

    Hi, although by now I know enough about making methods and constructors, they're definition...I don't know why I have problem with this exercise of my teacher...now I don't want anyone to write the...
Results 1 to 11 of 11