A Day 2 Exercise In Learning Java

Discussion in 'Programming General' started by jamesm201, Mar 2, 2011.

A Day 2 Exercise In Learning Java
  1. Unread #1 - Mar 2, 2011 at 5:36 PM
  2. jamesm201
    Joined:
    Feb 7, 2011
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    804740920511561790
    Discord Username:
    CPT72BUG

    jamesm201 Forum Addict

    A Day 2 Exercise In Learning Java

    Today we are going to use java to do a math problem.
    type in

    public class Add
    {
    public static void main (strings[]args)
    {
    int num;

    num = 5;

    system.out.print("the value of num is" );
    system.out.println(num);
    }
    }

    This creates a variable and tells the java program its there


    Doing this you tell the java program what it's value is

    if you noticed i put a ln after print in the system.out statement this tells it to put it with the one above and include it one one line so it looks like *The Value of num is 5*
     
  3. Unread #2 - Mar 2, 2011 at 6:03 PM
  4. rsgold4u
    Joined:
    Nov 17, 2007
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    rsgold4u Forum Addict
    Banned

    A Day 2 Exercise In Learning Java

    More corrections. int num;

    needs ; after your incorrect System.out.print statements.
     
  5. Unread #3 - Mar 2, 2011 at 6:23 PM
  6. jamesm201
    Joined:
    Feb 7, 2011
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    804740920511561790
    Discord Username:
    CPT72BUG

    jamesm201 Forum Addict

    A Day 2 Exercise In Learning Java

    what are you talking about?
     
  7. Unread #4 - Mar 2, 2011 at 6:36 PM
  8. rsgold4u
    Joined:
    Nov 17, 2007
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0

    rsgold4u Forum Addict
    Banned

    A Day 2 Exercise In Learning Java

    Kids these days.

    My post: Today, 06:03 PM
    Your edit: Last edited by jamesm201 : Today at 06:22 PM.

    Don't try to cover ur mistakes.
     
  9. Unread #5 - Mar 2, 2011 at 6:51 PM
  10. jamesm201
    Joined:
    Feb 7, 2011
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    804740920511561790
    Discord Username:
    CPT72BUG

    jamesm201 Forum Addict

    A Day 2 Exercise In Learning Java

    thanks dude i kind get blinded with those colored peaces with the /brown/color stuff that this fourm has
     
  11. Unread #6 - Mar 4, 2011 at 11:40 PM
  12. spedico
    Joined:
    Feb 5, 2011
    Posts:
    191
    Referrals:
    0
    Sythe Gold:
    0

    spedico Active Member
    $25 USD Donor New

    A Day 2 Exercise In Learning Java

    Try code tags..
    Code:
    hi
    Would be easier to read.
     
< Word chain solver | A Day 3 Exercise In Learning Java >

Users viewing this thread
1 guest


 
 
Adblock breaks this site