Yearly Archives

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

Comparison of Autoboxed Integer objects in Java

When we assign an integer value to an Integer object, the value is autoboxed into an Integer object. For...

Comparison of Autoboxed Integer objects in Java

When we assign an integer value to an Integer object, the value is autoboxed into an Integer object. For...

Java instanceof and its applications

instanceof is a keyword that is used for checking if a reference variable is containing a given type of...

Java instanceof and its applications

instanceof is a keyword that is used for checking if a reference variable is containing a given type of...

Bitwise right shift operators in Java

In C/C++ there is only one right shift operator ‘>>’ which should be used only for positive integers or...

Bitwise right shift operators in Java

In C/C++ there is only one right shift operator ‘>>’ which should be used only for positive integers or...