Java Console
Using scanner read user password from terminal isn’t practical due to sensitive data. Alternatively we can use Console class. Note! This program can be only execute from the terminal, it will not work in the IDE run java program.
Using scanner read user password from terminal isn’t practical due to sensitive data. Alternatively we can use Console class. Note! This program can be only execute from the terminal, it will not work in the IDE run java program.
InputStream in read user input from terminal bytes by bytes. We can use the Scanner class to read the whole string. To read integer, try enter any single digit from 0 – 9, What if you allow to enter more
This post will cover the following topics in this article Concatenation Performance comparison String Join Substring String Immutable String Pool and equality String compareTo Concatenation Plus operator, when 2 string are use with plus operator, string will be combine. Java
Primitive type compare using == , while object compare using equals method. When compare object with ==, we’re compare the reference (memory location) Integer Integer and Long type wrapper will always cache values in the range -128 to 127. If
This topic will discuss about incremental operation in Java. ++addFirst yield value increment before it used while addLater++ yield value before increment. These are know as pre-increment and post-increment. Another example Tricky question 1, what is the output? Keep in
This topic will talk about what is wrapper types, boxing, unboxing and autoboxing. A wrapper type is a class that encapsulates types. boolean => Boolean byte => Byte short => Short int = Integer long => Long float => Float
The simplest types in java are call primitive type. Java has 8 built-in primitive types, and each of these has default value when not declare in a method. boolean, 8-bits, default false byte, 8-bits default 0 short, 16-bits default 0