FileReader reader = new FileReader(file1);
FileWriter writer = new FileWriter(file2);
byte [] b = new byte[100];
int i=1;
while(reader.ready()){
b[i]=(byte) reader.read();
i++;}
for(i=1;i<b.length;i++){
if(i%2==0) {
writer.write(b[i]);
}
}
package com.codegym.task.task19.task1906;
/*
Even characters
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter 1");
String file1=r.readLine();
String file2=r.readLine();
FileReader reader = new FileReader(file1);
FileWriter writer = new FileWriter(file2);
byte [] b = new byte[100];
int i=1;
while(reader.ready()){
b[i]=(byte) reader.read();
i++;}
for(i=1;i<b.length;i++){
if(i%2==0) {
writer.write(b[i]);
System.out.print((Byte.toString(b[i])));
}
}
r.close();
reader.close();
writer.close();
}
}