Category Archives

Formatted output in Java

Sometimes in Competitive programming, it is essential to print the output in a given specified format. Most users are...

Formatted output in Java

Sometimes in Competitive programming, it is essential to print the output in a given specified format. Most users are...

Scanner and nextChar() in Java

Scanner class in Java supports nextInt(), nextLong(), nextDouble() etc. But there is no nextChar() (See this for examples) To...

Scanner and nextChar() in Java

Scanner class in Java supports nextInt(), nextLong(), nextDouble() etc. But there is no nextChar() (See this for examples) To...

Scanner Class in Java

Scanner is a class in java.util package used for obtaining the input of the primitive types like int, double,...

Scanner Class in Java

Scanner is a class in java.util package used for obtaining the input of the primitive types like int, double,...

DoubleStream mapToObj() in Java

DoubleStream mapToObj() returns an object-valued Stream consisting of the results of applying the given function. Syntax: <U> Stream<U> mapToObj(DoubleFunction<?...

DoubleStream mapToObj() in Java

DoubleStream mapToObj() returns an object-valued Stream consisting of the results of applying the given function. Syntax: <U> Stream<U> mapToObj(DoubleFunction<?...

Addition and Concatenation in Java

Try to predict the output of following code: public class PrutordotAi { public static void main(String args) { System.out.println(2+0+1+6+"PrutordotAi");...

Addition and Concatenation in Java

Try to predict the output of following code: public class PrutordotAi { public static void main(String args) { System.out.println(2+0+1+6+"PrutordotAi");...