What Will Be The Output Of The Following Java Programp Pre #451
What will be the output of the following Java program?</p> <pre><code class="language-java" line="1"> import java.lang.System; class Output { public static void main(String args[]) { byte a[] = { 65, 66, 67, 68, 69, 70 }; byte b[] = { 71, 72, 73, 74, 75, 76 }; System.arraycopy(a, 0, b, 0, a.length); System.out.print(new String(a) + " " + new String(b)); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Exploring Java Lang Java IO - Java.lang - System Class Advance - Quiz No.1.
What will be the output of the following Java program?
import java.lang.System; class Output { public static void main(String args[]) { byte a[] = { 65, 66, 67, 68, 69, 70 }; byte b[] = { 71, 72, 73, 74, 75, 76 }; System.arraycopy(a, 0, b, 0, a.length); System.out.print(new String(a) + " " + new String(b)); } }
ABCDEF ABCDEF
ABCDEF GHIJKL
GHIJKL ABCDEF
GHIJKL GHIJKL