Search:

Type: Posts; User: Scren

Search: Search took 0.13 seconds.

  1. Replies
    9
    Views
    1,033

    Re: Creating a new variable from two others

    Cheers Koti - would it not be



    s.close();


    in that instance?
  2. Replies
    9
    Views
    1,033

    Re: Creating a new variable from two others

    Ah makes sense and I instantly feel a bit silly, cheers greg.
  3. Replies
    9
    Views
    1,033

    Re: Creating a new variable from two others

    But looking at the code in my first post - I've created a new scanner for each one, name1, name2, age.....

    Is there a better way that I should have done this?

    cheers
  4. Replies
    9
    Views
    1,033

    Re: Creating a new variable from two others

    Ah right - so all the lines that I've written that create new scanners are wrong... And I should just write


    Scanner age = (System.in)

    ?
  5. Replies
    9
    Views
    1,033

    Creating a new variable from two others

    Hello, very new... I've just been playing around with a program that's meant to ask the user for their name and age...

    Here's the code :



    import java.util.Scanner;

    public class Noerng {
Results 1 to 5 of 5