Assuming all the necessary imports are done, predict the output of the below code:
public class FileStreamDemo {
public static void main(String[] args) throws Exception {
FileOutputStream fos = new FileOutputStream("sample.txt");
String text = "Java Basics";
byte[] b = text.getBytes();
fos.write(b);
FileInputStream fis = new FileInputStream("sample.txt");
int i = fis.read();
System.out.println((char)i);
fos.close();
fis.close();
}
}
J
Java
Java Basics
Basics
To get all Infosys Certified L1 Junior Java Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee