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: guide

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default guide

    public class Main {
        public static void main(String[] args) {
            String s1 = "H";
            int num = 3110;
            String s2 = s1+num;
            int n = 0;
            String s3 = "w"+n+"rld";
            double d = 2.0;
            boolean b = true;
           String s4 = s2 + s3 + d + b;
            System.out.println(s4);        
        }
    }


    --- Update ---

    hello everyone i just tried above code but the o/p looks like H3110 w0rld 2.0 true not getting how to give spaces while printing so guide me
    Last edited by Norm; December 6th, 2013 at 06:49 PM. Reason: explination // added missing ]


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,130
    Thanks
    52
    Thanked 2,286 Times in 2,257 Posts

    Default Re: guide

    how to give spaces
    Put them in a String with "s For example: " "
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: guide

    thank u

Similar Threads

  1. Can any body guide me please
    By ISHAQ KIYAWA in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 28th, 2013, 05:39 AM
  2. please guide me
    By ISHAQ KIYAWA in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 18th, 2013, 12:34 PM
  3. guide me please
    By ISHAQ KIYAWA in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 18th, 2013, 11:02 AM
  4. Guide me
    By sushil_p87 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 3rd, 2013, 09:06 AM