Results 1 to 3 of 3
  1. #1
    fernando is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Help with variables in java

    Hi, All the online/manual and online tutorials explain how to initially assign something to a variable, but how do you change it when the program is running? In BASIC something like "if a$ = 2 then b$ = 3"

    Also how can you take a string, say an input and assign it to a variable instead of using "system.out.println"

    But how do you do this in JAVA? I'm not used to high level programming - BASIC is about as high level as I know.

    Thanks.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Java Code:
    String input = reader.readLine();
    String s = "hello world";
    input = s;

  3. #3
    yiweiang is offline Member
    Join Date
    Aug 2007
    Posts
    15
    Rep Power
    0

    Default

    Java Code:
    if(a$==2)
    {
    b$=3;
    }
    is this what you are saying?

Similar Threads

  1. boolean variables
    By ravian in forum New To Java
    Replies: 3
    Last Post: 12-31-2007, 04:58 AM
  2. Variables
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 12:44 PM
  3. variables-methods
    By Warren in forum New To Java
    Replies: 1
    Last Post: 11-28-2007, 04:14 PM
  4. Problem with variables in java
    By carl in forum AWT / Swing
    Replies: 1
    Last Post: 07-31-2007, 07:50 PM
  5. I do not know how to initialize the two variables
    By Daniel in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 04:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •