Question:

How do print a String of 4 numbers with JAVA?

by  |  earlier

0 LIKES UnLike

Write an application that displays the numbers 1 to 4 on the same line, with each pair of adjacent numbers separated by one space. Write the program using four System.out statements.

 Tags:

   Report

3 ANSWERS


  1. just use the class String..


  2. public Class PrintText

    {

    public static void main(String[] args)

    {

       Systenm.out.println("1,2,3,4");

    }

    }

    // :)

    // If you have any questions try to visit

    // http://www.Easy-Registry-Clean.info

    // Good luck !:)

  3. Hope this was what you were looking for.

    //Code

    import java.io.*;

    class samp

    {

    public static void main(String system[])

    {

    System.out.print("1 ");

    System.out.print("2 ");

    System.out.print("3 ");

    System.out.print("4 ");

    }

    }

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.