Unknown Spacing Issue in Java Output












0














I have made this code to display an example of both a selection sort and a merge sort. I have gotten it to do it's job properly, but I seem to have a formatting issue for the output of the program. Underneath the sample of the selection sort, there is a space between the original and the sorted array when there should not be. I'm pretty sure it's in a certain method, the sort2 method, but I'm not sure. Appreciate the help!



    /*
*
*
*/

package asgn03;

import static java.lang.System.arraycopy;
import static java.lang.System.out;
import java.util.Arrays;
import java.util.Random;

/**
*
* @author millerh9
*/
public class Asgn03 {
final static Random rand = new Random();

/**
* @param args the command line arguments
*/
public static void main(String args) {

// TODO code application logic here
int arr = new int[20];
for (int j = 0; j < arr.length; j++) {
arr[j] = rand.nextInt(100);
}
out.println("CPS 151 Assignment 3 By Harper Miller");
out.println();
out.println("Demonstrate Merge Sort");
out.println("Original array: " + Arrays.toString(arr));
sort(arr);
out.println("Sorted array: " + Arrays.toString(arr));
out.println();
out.println("Demonstrate Selection Sort");
out.println("Original array: " + Arrays.toString(arr));
sort2(arr);
out.println("nSorted array: " + Arrays.toString(arr));

} // end main

// sorts an array of integers (shell function for public use)
public static void sort(final int arr) {
sort(arr, 0, arr.length - 1, 0);
} // end public sort

// sort the segment arr[low:high], its length is (high - low + 1)
private static void sort(final int arr, final int low, final int high,
int level) {
// Base case: a segment of length <= 1 is sorted by definition
if (high - low <= 0)
return;

// trace output



// Recursive case: segment length > 1
// Consider arr[low:high] split into arr[low:mid] and arr[mid+1:high]
// and sort them recursively where mid = (low + high) / 2
final int mid = (low + high) / 2;
sort(arr, low, mid, level + 1);
sort(arr, mid + 1, high, level + 1);

// merge arr[low:mid] and arr[mid+1:high] into arr[low:mid]
merge(arr, low, high, level);
} // end private sort

private static void merge(final int arr, final int low, final int high,
int level) {
// array segment arr[low:high] contains two sorted subsegments arr[low:mid]
// and arr[mid+1:high] where mid = (low + high) / 2
final int mid = (low + high) / 2;
// temporary array into which the segments arr[low:mid] and arr[mid+1:high]
// are merged. The size needed is high - low + 1
final int tempArr = new int[high - low + 1];

// index variables set into segments to merge and into the tempArray
int index1 = low, index2 = mid + 1, index3 = 0;




while (index1 <= mid && index2 <= high) {
if (arr[index1] <= arr[index2]) { // copy from first segment
tempArr[index3] = arr[index1];
index1++;
} else { // copy from second segment
tempArr[index3] = arr[index2];
index2++;
} // end if
index3++;
} // end loop

// number of values left over (not copied into tempArr yet)
// from first segment: mid - index1 + 1
// from second segment: high - index2 + 1
// Note that only one segment will have leftovers so
// one of the following arraycopy's will not do anything
arraycopy(arr, index1, tempArr, index3, mid - index1 + 1);
arraycopy(arr, index2, tempArr, index3, high - index2 + 1);

// copy back from tempArr to arr[low:high]
arraycopy(tempArr, 0, arr, low, tempArr.length);
} // end merge

// sort the segment arr[low:high], its length is (high - low + 1)
private static String segmentToString(int arr, int low, int high) {
if (low > high)
return "";

// at least one value
String str = "[" + arr[low];
for (int index = low + 1; index <= high; index++)
str = str + ", " + arr[index];

return str + "]";
} // end segmentToString
private static void sort2(int arr) {
final int n = arr.length; // size of array

for (int k = 0; k < n - 1; k++) {
int minIndex = getIndexOfMin(arr, k, n - 1);
swap(arr, k, minIndex);

} // end outer loop
} // end sort

private static int getIndexOfMin(int arr, int startAt, int lastIndex) {
int minIndex = startAt;

for (int index = startAt + 1; index <= lastIndex; index++) {
if (arr[index] < arr[minIndex]) // found a smaller value
minIndex = index;
} // end loop
return minIndex;
} // end method

private static void swap(int arr, int k, int i) {
int temp = arr[i];
arr[i] = arr[k];
arr[k] = temp;
} // end swap


} // end class









share|improve this question



























    0














    I have made this code to display an example of both a selection sort and a merge sort. I have gotten it to do it's job properly, but I seem to have a formatting issue for the output of the program. Underneath the sample of the selection sort, there is a space between the original and the sorted array when there should not be. I'm pretty sure it's in a certain method, the sort2 method, but I'm not sure. Appreciate the help!



        /*
    *
    *
    */

    package asgn03;

    import static java.lang.System.arraycopy;
    import static java.lang.System.out;
    import java.util.Arrays;
    import java.util.Random;

    /**
    *
    * @author millerh9
    */
    public class Asgn03 {
    final static Random rand = new Random();

    /**
    * @param args the command line arguments
    */
    public static void main(String args) {

    // TODO code application logic here
    int arr = new int[20];
    for (int j = 0; j < arr.length; j++) {
    arr[j] = rand.nextInt(100);
    }
    out.println("CPS 151 Assignment 3 By Harper Miller");
    out.println();
    out.println("Demonstrate Merge Sort");
    out.println("Original array: " + Arrays.toString(arr));
    sort(arr);
    out.println("Sorted array: " + Arrays.toString(arr));
    out.println();
    out.println("Demonstrate Selection Sort");
    out.println("Original array: " + Arrays.toString(arr));
    sort2(arr);
    out.println("nSorted array: " + Arrays.toString(arr));

    } // end main

    // sorts an array of integers (shell function for public use)
    public static void sort(final int arr) {
    sort(arr, 0, arr.length - 1, 0);
    } // end public sort

    // sort the segment arr[low:high], its length is (high - low + 1)
    private static void sort(final int arr, final int low, final int high,
    int level) {
    // Base case: a segment of length <= 1 is sorted by definition
    if (high - low <= 0)
    return;

    // trace output



    // Recursive case: segment length > 1
    // Consider arr[low:high] split into arr[low:mid] and arr[mid+1:high]
    // and sort them recursively where mid = (low + high) / 2
    final int mid = (low + high) / 2;
    sort(arr, low, mid, level + 1);
    sort(arr, mid + 1, high, level + 1);

    // merge arr[low:mid] and arr[mid+1:high] into arr[low:mid]
    merge(arr, low, high, level);
    } // end private sort

    private static void merge(final int arr, final int low, final int high,
    int level) {
    // array segment arr[low:high] contains two sorted subsegments arr[low:mid]
    // and arr[mid+1:high] where mid = (low + high) / 2
    final int mid = (low + high) / 2;
    // temporary array into which the segments arr[low:mid] and arr[mid+1:high]
    // are merged. The size needed is high - low + 1
    final int tempArr = new int[high - low + 1];

    // index variables set into segments to merge and into the tempArray
    int index1 = low, index2 = mid + 1, index3 = 0;




    while (index1 <= mid && index2 <= high) {
    if (arr[index1] <= arr[index2]) { // copy from first segment
    tempArr[index3] = arr[index1];
    index1++;
    } else { // copy from second segment
    tempArr[index3] = arr[index2];
    index2++;
    } // end if
    index3++;
    } // end loop

    // number of values left over (not copied into tempArr yet)
    // from first segment: mid - index1 + 1
    // from second segment: high - index2 + 1
    // Note that only one segment will have leftovers so
    // one of the following arraycopy's will not do anything
    arraycopy(arr, index1, tempArr, index3, mid - index1 + 1);
    arraycopy(arr, index2, tempArr, index3, high - index2 + 1);

    // copy back from tempArr to arr[low:high]
    arraycopy(tempArr, 0, arr, low, tempArr.length);
    } // end merge

    // sort the segment arr[low:high], its length is (high - low + 1)
    private static String segmentToString(int arr, int low, int high) {
    if (low > high)
    return "";

    // at least one value
    String str = "[" + arr[low];
    for (int index = low + 1; index <= high; index++)
    str = str + ", " + arr[index];

    return str + "]";
    } // end segmentToString
    private static void sort2(int arr) {
    final int n = arr.length; // size of array

    for (int k = 0; k < n - 1; k++) {
    int minIndex = getIndexOfMin(arr, k, n - 1);
    swap(arr, k, minIndex);

    } // end outer loop
    } // end sort

    private static int getIndexOfMin(int arr, int startAt, int lastIndex) {
    int minIndex = startAt;

    for (int index = startAt + 1; index <= lastIndex; index++) {
    if (arr[index] < arr[minIndex]) // found a smaller value
    minIndex = index;
    } // end loop
    return minIndex;
    } // end method

    private static void swap(int arr, int k, int i) {
    int temp = arr[i];
    arr[i] = arr[k];
    arr[k] = temp;
    } // end swap


    } // end class









    share|improve this question

























      0












      0








      0







      I have made this code to display an example of both a selection sort and a merge sort. I have gotten it to do it's job properly, but I seem to have a formatting issue for the output of the program. Underneath the sample of the selection sort, there is a space between the original and the sorted array when there should not be. I'm pretty sure it's in a certain method, the sort2 method, but I'm not sure. Appreciate the help!



          /*
      *
      *
      */

      package asgn03;

      import static java.lang.System.arraycopy;
      import static java.lang.System.out;
      import java.util.Arrays;
      import java.util.Random;

      /**
      *
      * @author millerh9
      */
      public class Asgn03 {
      final static Random rand = new Random();

      /**
      * @param args the command line arguments
      */
      public static void main(String args) {

      // TODO code application logic here
      int arr = new int[20];
      for (int j = 0; j < arr.length; j++) {
      arr[j] = rand.nextInt(100);
      }
      out.println("CPS 151 Assignment 3 By Harper Miller");
      out.println();
      out.println("Demonstrate Merge Sort");
      out.println("Original array: " + Arrays.toString(arr));
      sort(arr);
      out.println("Sorted array: " + Arrays.toString(arr));
      out.println();
      out.println("Demonstrate Selection Sort");
      out.println("Original array: " + Arrays.toString(arr));
      sort2(arr);
      out.println("nSorted array: " + Arrays.toString(arr));

      } // end main

      // sorts an array of integers (shell function for public use)
      public static void sort(final int arr) {
      sort(arr, 0, arr.length - 1, 0);
      } // end public sort

      // sort the segment arr[low:high], its length is (high - low + 1)
      private static void sort(final int arr, final int low, final int high,
      int level) {
      // Base case: a segment of length <= 1 is sorted by definition
      if (high - low <= 0)
      return;

      // trace output



      // Recursive case: segment length > 1
      // Consider arr[low:high] split into arr[low:mid] and arr[mid+1:high]
      // and sort them recursively where mid = (low + high) / 2
      final int mid = (low + high) / 2;
      sort(arr, low, mid, level + 1);
      sort(arr, mid + 1, high, level + 1);

      // merge arr[low:mid] and arr[mid+1:high] into arr[low:mid]
      merge(arr, low, high, level);
      } // end private sort

      private static void merge(final int arr, final int low, final int high,
      int level) {
      // array segment arr[low:high] contains two sorted subsegments arr[low:mid]
      // and arr[mid+1:high] where mid = (low + high) / 2
      final int mid = (low + high) / 2;
      // temporary array into which the segments arr[low:mid] and arr[mid+1:high]
      // are merged. The size needed is high - low + 1
      final int tempArr = new int[high - low + 1];

      // index variables set into segments to merge and into the tempArray
      int index1 = low, index2 = mid + 1, index3 = 0;




      while (index1 <= mid && index2 <= high) {
      if (arr[index1] <= arr[index2]) { // copy from first segment
      tempArr[index3] = arr[index1];
      index1++;
      } else { // copy from second segment
      tempArr[index3] = arr[index2];
      index2++;
      } // end if
      index3++;
      } // end loop

      // number of values left over (not copied into tempArr yet)
      // from first segment: mid - index1 + 1
      // from second segment: high - index2 + 1
      // Note that only one segment will have leftovers so
      // one of the following arraycopy's will not do anything
      arraycopy(arr, index1, tempArr, index3, mid - index1 + 1);
      arraycopy(arr, index2, tempArr, index3, high - index2 + 1);

      // copy back from tempArr to arr[low:high]
      arraycopy(tempArr, 0, arr, low, tempArr.length);
      } // end merge

      // sort the segment arr[low:high], its length is (high - low + 1)
      private static String segmentToString(int arr, int low, int high) {
      if (low > high)
      return "";

      // at least one value
      String str = "[" + arr[low];
      for (int index = low + 1; index <= high; index++)
      str = str + ", " + arr[index];

      return str + "]";
      } // end segmentToString
      private static void sort2(int arr) {
      final int n = arr.length; // size of array

      for (int k = 0; k < n - 1; k++) {
      int minIndex = getIndexOfMin(arr, k, n - 1);
      swap(arr, k, minIndex);

      } // end outer loop
      } // end sort

      private static int getIndexOfMin(int arr, int startAt, int lastIndex) {
      int minIndex = startAt;

      for (int index = startAt + 1; index <= lastIndex; index++) {
      if (arr[index] < arr[minIndex]) // found a smaller value
      minIndex = index;
      } // end loop
      return minIndex;
      } // end method

      private static void swap(int arr, int k, int i) {
      int temp = arr[i];
      arr[i] = arr[k];
      arr[k] = temp;
      } // end swap


      } // end class









      share|improve this question













      I have made this code to display an example of both a selection sort and a merge sort. I have gotten it to do it's job properly, but I seem to have a formatting issue for the output of the program. Underneath the sample of the selection sort, there is a space between the original and the sorted array when there should not be. I'm pretty sure it's in a certain method, the sort2 method, but I'm not sure. Appreciate the help!



          /*
      *
      *
      */

      package asgn03;

      import static java.lang.System.arraycopy;
      import static java.lang.System.out;
      import java.util.Arrays;
      import java.util.Random;

      /**
      *
      * @author millerh9
      */
      public class Asgn03 {
      final static Random rand = new Random();

      /**
      * @param args the command line arguments
      */
      public static void main(String args) {

      // TODO code application logic here
      int arr = new int[20];
      for (int j = 0; j < arr.length; j++) {
      arr[j] = rand.nextInt(100);
      }
      out.println("CPS 151 Assignment 3 By Harper Miller");
      out.println();
      out.println("Demonstrate Merge Sort");
      out.println("Original array: " + Arrays.toString(arr));
      sort(arr);
      out.println("Sorted array: " + Arrays.toString(arr));
      out.println();
      out.println("Demonstrate Selection Sort");
      out.println("Original array: " + Arrays.toString(arr));
      sort2(arr);
      out.println("nSorted array: " + Arrays.toString(arr));

      } // end main

      // sorts an array of integers (shell function for public use)
      public static void sort(final int arr) {
      sort(arr, 0, arr.length - 1, 0);
      } // end public sort

      // sort the segment arr[low:high], its length is (high - low + 1)
      private static void sort(final int arr, final int low, final int high,
      int level) {
      // Base case: a segment of length <= 1 is sorted by definition
      if (high - low <= 0)
      return;

      // trace output



      // Recursive case: segment length > 1
      // Consider arr[low:high] split into arr[low:mid] and arr[mid+1:high]
      // and sort them recursively where mid = (low + high) / 2
      final int mid = (low + high) / 2;
      sort(arr, low, mid, level + 1);
      sort(arr, mid + 1, high, level + 1);

      // merge arr[low:mid] and arr[mid+1:high] into arr[low:mid]
      merge(arr, low, high, level);
      } // end private sort

      private static void merge(final int arr, final int low, final int high,
      int level) {
      // array segment arr[low:high] contains two sorted subsegments arr[low:mid]
      // and arr[mid+1:high] where mid = (low + high) / 2
      final int mid = (low + high) / 2;
      // temporary array into which the segments arr[low:mid] and arr[mid+1:high]
      // are merged. The size needed is high - low + 1
      final int tempArr = new int[high - low + 1];

      // index variables set into segments to merge and into the tempArray
      int index1 = low, index2 = mid + 1, index3 = 0;




      while (index1 <= mid && index2 <= high) {
      if (arr[index1] <= arr[index2]) { // copy from first segment
      tempArr[index3] = arr[index1];
      index1++;
      } else { // copy from second segment
      tempArr[index3] = arr[index2];
      index2++;
      } // end if
      index3++;
      } // end loop

      // number of values left over (not copied into tempArr yet)
      // from first segment: mid - index1 + 1
      // from second segment: high - index2 + 1
      // Note that only one segment will have leftovers so
      // one of the following arraycopy's will not do anything
      arraycopy(arr, index1, tempArr, index3, mid - index1 + 1);
      arraycopy(arr, index2, tempArr, index3, high - index2 + 1);

      // copy back from tempArr to arr[low:high]
      arraycopy(tempArr, 0, arr, low, tempArr.length);
      } // end merge

      // sort the segment arr[low:high], its length is (high - low + 1)
      private static String segmentToString(int arr, int low, int high) {
      if (low > high)
      return "";

      // at least one value
      String str = "[" + arr[low];
      for (int index = low + 1; index <= high; index++)
      str = str + ", " + arr[index];

      return str + "]";
      } // end segmentToString
      private static void sort2(int arr) {
      final int n = arr.length; // size of array

      for (int k = 0; k < n - 1; k++) {
      int minIndex = getIndexOfMin(arr, k, n - 1);
      swap(arr, k, minIndex);

      } // end outer loop
      } // end sort

      private static int getIndexOfMin(int arr, int startAt, int lastIndex) {
      int minIndex = startAt;

      for (int index = startAt + 1; index <= lastIndex; index++) {
      if (arr[index] < arr[minIndex]) // found a smaller value
      minIndex = index;
      } // end loop
      return minIndex;
      } // end method

      private static void swap(int arr, int k, int i) {
      int temp = arr[i];
      arr[i] = arr[k];
      arr[k] = temp;
      } // end swap


      } // end class






      java netbeans






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 0:56









      Harper Miller

      83




      83
























          2 Answers
          2






          active

          oldest

          votes


















          1















          there is a space between the original and the sorted array when there should not be.




          This is because you have a newline character in your println:



          out.println("Original array: " + Arrays.toString(arr));
          //Newline printed by the println statement
          sort2(arr);
          out.println("nSorted array: " + Arrays.toString(arr));
          // ^^^newline right here


          Which results in the extra space. Simply change it to:



          out.println("Sorted array: " + Arrays.toString(arr));





          share|improve this answer

















          • 1




            Ah, I completely forgot about that n. Thanks for the help!
            – Harper Miller
            Nov 14 '18 at 1:04



















          0














          out.println("Original array: " + Arrays.toString(arr));
          sort2(arr);
          out.println("nSorted array: " + Arrays.toString(arr));


          println prints to a new line and you start your string with a new line nSorted






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291664%2funknown-spacing-issue-in-java-output%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1















            there is a space between the original and the sorted array when there should not be.




            This is because you have a newline character in your println:



            out.println("Original array: " + Arrays.toString(arr));
            //Newline printed by the println statement
            sort2(arr);
            out.println("nSorted array: " + Arrays.toString(arr));
            // ^^^newline right here


            Which results in the extra space. Simply change it to:



            out.println("Sorted array: " + Arrays.toString(arr));





            share|improve this answer

















            • 1




              Ah, I completely forgot about that n. Thanks for the help!
              – Harper Miller
              Nov 14 '18 at 1:04
















            1















            there is a space between the original and the sorted array when there should not be.




            This is because you have a newline character in your println:



            out.println("Original array: " + Arrays.toString(arr));
            //Newline printed by the println statement
            sort2(arr);
            out.println("nSorted array: " + Arrays.toString(arr));
            // ^^^newline right here


            Which results in the extra space. Simply change it to:



            out.println("Sorted array: " + Arrays.toString(arr));





            share|improve this answer

















            • 1




              Ah, I completely forgot about that n. Thanks for the help!
              – Harper Miller
              Nov 14 '18 at 1:04














            1












            1








            1







            there is a space between the original and the sorted array when there should not be.




            This is because you have a newline character in your println:



            out.println("Original array: " + Arrays.toString(arr));
            //Newline printed by the println statement
            sort2(arr);
            out.println("nSorted array: " + Arrays.toString(arr));
            // ^^^newline right here


            Which results in the extra space. Simply change it to:



            out.println("Sorted array: " + Arrays.toString(arr));





            share|improve this answer













            there is a space between the original and the sorted array when there should not be.




            This is because you have a newline character in your println:



            out.println("Original array: " + Arrays.toString(arr));
            //Newline printed by the println statement
            sort2(arr);
            out.println("nSorted array: " + Arrays.toString(arr));
            // ^^^newline right here


            Which results in the extra space. Simply change it to:



            out.println("Sorted array: " + Arrays.toString(arr));






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 14 '18 at 1:02









            GBlodgett

            9,21741633




            9,21741633








            • 1




              Ah, I completely forgot about that n. Thanks for the help!
              – Harper Miller
              Nov 14 '18 at 1:04














            • 1




              Ah, I completely forgot about that n. Thanks for the help!
              – Harper Miller
              Nov 14 '18 at 1:04








            1




            1




            Ah, I completely forgot about that n. Thanks for the help!
            – Harper Miller
            Nov 14 '18 at 1:04




            Ah, I completely forgot about that n. Thanks for the help!
            – Harper Miller
            Nov 14 '18 at 1:04













            0














            out.println("Original array: " + Arrays.toString(arr));
            sort2(arr);
            out.println("nSorted array: " + Arrays.toString(arr));


            println prints to a new line and you start your string with a new line nSorted






            share|improve this answer


























              0














              out.println("Original array: " + Arrays.toString(arr));
              sort2(arr);
              out.println("nSorted array: " + Arrays.toString(arr));


              println prints to a new line and you start your string with a new line nSorted






              share|improve this answer
























                0












                0








                0






                out.println("Original array: " + Arrays.toString(arr));
                sort2(arr);
                out.println("nSorted array: " + Arrays.toString(arr));


                println prints to a new line and you start your string with a new line nSorted






                share|improve this answer












                out.println("Original array: " + Arrays.toString(arr));
                sort2(arr);
                out.println("nSorted array: " + Arrays.toString(arr));


                println prints to a new line and you start your string with a new line nSorted







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 14 '18 at 1:01









                KameeCoding

                348420




                348420






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291664%2funknown-spacing-issue-in-java-output%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Guess what letter conforming each word

                    Port of Spain

                    Run scheduled task as local user group (not BUILTIN)