Search:

Type: Posts; User: hiro

Search: Search took 0.17 seconds.

  1. Re: Class Temperature, not sure about constructor/methods

    For example, one part task is: three methods that set value, unit (C or F) or value and unit
    My code would be:




    void setValue (float V) {
    Value = V;
    }
  2. Class Temperature, not sure about constructor/methods

    For my class I need 4 constructors, one for every object variable (set value to 0 and unit to Celsius), one with 2 parameters for the 2 objectvariables and one without arguments, whereas 0 degreeC is...
  3. Re: Integer values from a mixed textfile in Java using Scanner

    Thank you for you patience I finally have it!
  4. Re: Integer values from a mixed textfile in Java using Scanner

    static void readArray(String fileName) throws FileNotFoundException {

    Scanner s = new Scanner(new File(fileName));
    ArrayList<Integer> ArrayInt = new ArrayList<Integer>();

    while(s.hasNext())...
  5. Re: Integer values from a mixed textfile in Java using Scanner

    while(s.hasNext())
    {
    if(s.hasNextInt())
    ArrayInt.add(s.nextInt());
    else
    s.hasNext(); // from here on restart the loop?
    }

    Out.println(ArrayInt);
  6. [SOLVED] Integer values from a mixed textfile in Java using Scanner

    Hello, I am not sure how to read Integer values from a textfile that has "strings" and "ints" . I want to save strings in an array and int in an array so I can use them later on.
    For example, ask...
Results 1 to 6 of 6