The output of the program is:
[B@171ccb0[B@35378d
[B@1d23632
Required output is:
[B@171ccb0[B@35378d
[B@171ccb0[B@35378d
Please help...
import java.util.Scanner;
import java.io.InputStreamReader;
public class testme {
public static void main(String[] args) {
Scanner in = new Scanner(new InputStreamReader(System.in));
String s = "hello";
String sb = "hi";
String sc = s.concat(sb);
byte[] a, b;
a = s.getBytes();
b = sb.getBytes();
byte[] c = new byte[a.length + b.length];
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);
System.out.println(a + "" + b + "\n" + c);
}
}