import
java.io.StringWriter;
import
java.io.Writer;
public
class
GFG {
static
String writeByte(
byte
[] byteString,
byte
[] byteInt,
byte
[] byteChar,
byte
[] byteDouble)
{
Writer writer =
new
StringWriter();
try
{
writer
.append(
new
String(byteString)
+
new
String(byteDouble)
+
new
String(byteChar)
+
new
String(byteInt));
writer.close();
}
catch
(Exception e) {
System.out.println(
"Exception: "
+ e);
}
return
writer.toString();
}
public
static
void
main(String args[])
{
String str =
"Speed of light: "
;
int
num =
8
;
char
ch =
'e'
;
double
dec =
3.0
;
byte
[] byteString = str.getBytes();
byte
[] byteInt = Integer.toString(num).getBytes();
byte
[] byteChar = Character.toString(ch).getBytes();
byte
[] byteDouble = Double.toString(dec).getBytes();
System.out.println(writeByte(byteString, byteInt,
byteChar, byteDouble));
}
}