You are not logged in. Please login at www.codechef.com to post your questions!

×

Exception in thread "main" java.lang.NullPointerException at ANKTRAIN.main(Main.java:11)

I dont understand why this runtime error pops,whenever i try to run on codchef online IDE,whereas on other IDE it works perfectly fine with sample inputs and other inputs as well.

import java.io.*;
import java.util.*;
class ANKTRAIN
{

    public static void main(String args[]) throws java.io.IOException 
{

       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        long t =Long.parseLong(br.readLine().trim());

asked 07 Dec '16, 15:09

raghaw's gravatar image

1★raghaw
21
accept rate: 0%

edited 21 Apr, 12:31

vijju123's gravatar image

4★vijju123 ♦
11.3k1316


You may use java.util.Scanner for this.

Scanner sc = new Scanner(System.in);

long t = sc.nextLong();

link

answered 21 Apr, 13:20

onkarnandedkar's gravatar image

4★onkarnandedkar
212
accept rate: 0%

fed up with the same problem.........

link

answered 21 Apr, 10:29

rajyelchuri's gravatar image

1★rajyelchuri
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,064
×30
×5

question asked: 07 Dec '16, 15:09

question was seen: 716 times

last updated: 21 Apr, 13:20