Category Archives

Fast I/O in Java in Competitive Programming

Using Java in competitive programming is not something many people would suggest just because of its slow input and...

Fast I/O in Java in Competitive Programming

Using Java in competitive programming is not something many people would suggest just because of its slow input and...

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...

Difference between Scanner and BufferReader Class in Java

java.util.Scanner class is a simple text scanner which can parse primitive types and strings. It internally uses regular expressions...

Difference between Scanner and BufferReader Class in Java

java.util.Scanner class is a simple text scanner which can parse primitive types and strings. It internally uses regular expressions...

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,...

Command Line arguments in Java

If we run a Java Program by writing the command “java Hello learn programming at prutor.ai” where the name...

Command Line arguments in Java

If we run a Java Program by writing the command “java Hello learn programming at prutor.ai” where the name...

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<?...

Character Stream Vs Byte Stream in Java

I/O Stream A stream is a method to sequentially access a file. I/O Stream means an input source or...

Character Stream Vs Byte Stream in Java

I/O Stream A stream is a method to sequentially access a file. I/O Stream means an input source or...

Java Numeric Promotion in Conditional Expression

The conditional operator ? : uses the boolean value of one expression to decide which of two other expressions...

Java Numeric Promotion in Conditional Expression

The conditional operator ? : uses the boolean value of one expression to decide which of two other expressions...

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");...