Adblock breaks this site

A Day 2 Exercise In Learning Java

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

  1. jamesm201

    jamesm201 Forum Addict

    Joined:
    Feb 7, 2011
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    804740920511561790
    Discord Username:
    CPT72BUG
    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*
     
  2. rsgold4u

    rsgold4u Forum Addict
    Banned

    Joined:
    Nov 17, 2007
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0
    A Day 2 Exercise In Learning Java

    More corrections. int num;

    needs ; after your incorrect System.out.print statements.
     
  3. jamesm201

    jamesm201 Forum Addict

    Joined:
    Feb 7, 2011
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    804740920511561790
    Discord Username:
    CPT72BUG
    A Day 2 Exercise In Learning Java

    what are you talking about?
     
  4. rsgold4u

    rsgold4u Forum Addict
    Banned

    Joined:
    Nov 17, 2007
    Posts:
    328
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  5. jamesm201

    jamesm201 Forum Addict

    Joined:
    Feb 7, 2011
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    22
    Discord Unique ID:
    804740920511561790
    Discord Username:
    CPT72BUG
    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
     
  6. spedico

    spedico Active Member
    $25 USD Donor New

    Joined:
    Feb 5, 2011
    Posts:
    191
    Referrals:
    0
    Sythe Gold:
    0
    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 >


 
 
Adblock breaks this site