1 / 5
Feb 2013

Hello,
I am new to this site and
I am trying to submit solution of "universe" problem but i am getting compile error each time i am submitting the solution.
Here is my code:

public class Main {

public static void main (String[] args) throws java.lang.Exception
  {
     BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
     String s;
     while (!(s=r.readLine()).startsWith("42")) System.out.println(s);
  }

}

please tell me where i am going wrong.

  • created

    Feb '13
  • last reply

    Nov '13
  • 4

    replies

  • 315

    views

  • 3

    users

If you click where it says "Compile Error" it will tell you what error the compiler is giving.

8 months later

you didn't import anything import java.io.BufferedReader;
import java.io.InputStreamReader; and compile again.

Are you asking this question because you are trying to be helpful or are you asking because you want the answer?

Suggested Topics

Want to read more? Browse other topics in JAVA based languages or view latest topics.