import java.util.;
import java.io.;
import java.lang.*;public class Tester {
public static void main(String a[])
{String s; int len; Scanner sc=new Scanner(System.in); s=sc.nextLine(); StringBuffer sb=new StringBuffer(s); int i= 1; len= sb.length(); len=len-1; while(i<=len) { sb.deleteCharAt(i); i=i+2;
}
System.out.println(sb);}
}
Can you share the exception details itself… and some stack trace…
There is no error except in these lines:
import java.util.*;
import java.io.*;
Yes, but what’s the error can you share the error you see? screenshots…etc
It is just a syntax error. It is necessary for the statement to be like
import java.util.*;
Unlike
import java.util.;
Similarly for the other line.