Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Ubale to see sysout output in console

  1. #1
    Junior Member
    Join Date
    Apr 2020
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ubale to see sysout output in console

    Unable to see the System.out.println("The value of the variable m is "+m);

    the output in console

    What is the error in the code please can you share


    package Introduction;

    public class Example {

    public static void main(String[] args) {
    // TODO Auto-generated method stub
    long a = 12345;long b = 54321; long c = 5678; long d= 8765;
    long m = a+b+c+d;
    System.out.println("The value of the variable m is "+m);
    float f = (a+b)/(c+d);
    System.out.println("f = "+f);
    float g = (a+b)/(c+d); System.out.println("g = "+g);
    double h = (a+b)/(c+d); System.out.println("h = "+h);
    double aa= 40.24; double bb=50.44; double i = aa+bb;
    System.out.println("the value of i = "+i);
    float cc= 40.24F; float dd = 50.44F; float k = dd-cc; System.out.println("the value of k = "+k);
    System.out.println("The value of the variable m is "+m);
    }

    }


    The console of the above is :
    g = 4.0
    h = 4.0
    the value of i = 90.68
    the value of k = 10.199997
    The value of the variable m is 81109

    --- Update ---

    Hi,

    I cant see the output of this command in the console
    System.out.println("The value of the variable m is "+m);

    Please can you share the error in this code

    The code is :

    package Introduction;

    public class Example {

    public static void main(String[] args) {
    // TODO Auto-generated method stub
    long a = 12345;long b = 54321; long c = 5678; long d= 8765;
    long m = a+b+c+d;
    System.out.println("The value of the variable m is "+m);
    float f = (a+b)/(c+d);
    System.out.println("f = "+f);
    float g = (a+b)/(c+d); System.out.println("g = "+g);
    double h = (a+b)/(c+d); System.out.println("h = "+h);
    double aa= 40.24; double bb=50.44; double i = aa+bb;
    System.out.println("the value of i = "+i);
    float cc= 40.24F; float dd = 50.44F; float k = dd-cc; System.out.println("the value of k = "+k);

    }

    }


    The console is:

    f = 4.0
    g = 4.0
    h = 4.0
    the value of i = 90.68
    the value of k = 10.199997

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Ubale to see sysout output in console

    Unable to see the System.out.println("The value of the variable m is "+m);
    Please explain.
    You posted the following:
    The console of the above is :
    g = 4.0
    h = 4.0
    the value of i = 90.68
    the value of k = 10.199997
    The value of the variable m is 81109 <<<<<<<< THIS LOOKS like it here????
    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Mar 2020
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Ubale to see sysout output in console

    I ran your code and that line prints out for me.

Similar Threads

  1. Help with formatting output into console
    By Buckeye1 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: November 1st, 2019, 02:49 PM
  2. How to clear Java output console
    By rita khatei in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 2nd, 2014, 03:42 PM
  3. Replies: 2
    Last Post: June 20th, 2013, 10:02 PM
  4. Having problems with output to console....help!
    By toppcon in forum What's Wrong With My Code?
    Replies: 21
    Last Post: July 13th, 2011, 06:38 PM
  5. Changing output from console to .html
    By RSYR in forum File I/O & Other I/O Streams
    Replies: 6
    Last Post: December 10th, 2009, 07:55 PM