isDigit in Java
isDigit is a static method of Character class. It is used to determine whether a character is a digit or not. If the character is digit then isDigit return true otherwise it return false. Let us look at an example code : Output
Technology for All
isDigit is a static method of Character class. It is used to determine whether a character is a digit or not. If the character is digit then isDigit return true otherwise it return false. Let us look at an example code : Output
Comparator Interface is a very useful interface which is used to sort the objects on some predefined conditions. Usually when we want to sort Integer type ArrayList then we use Collections.sort(arrayListName). This will sort the list of integers in ascending order. But what if we want to sort Student objects based on the marks students … Read more
Integer is stored in 32 bits of memory. To find max and min values of Integer in Java we can use inbuilt fields of Integer class : Integer.MAX_VALUE = 2147483647 Integer.MIN_VALUE = -2147483648 Let us look at the example code : Output
Long is stored in 64 bits of memory. To find max and min values of Long in Java we can use inbuilt fields of Long class : Long.MAX_VALUE = 9223372036854775807 Long.MIN_VALUE = -9223372036854775808 Let us look at the example code : Output
In Java if we want to terminate the execution of the program then we make use of System.exit(n) method. Let us see important points : System.exit(n) method takes a non zero argument to indicate abnormal termination. System.exit(n) will exit the program irrespective of the operation being performed. If we call System.exit(n) within a try catch … Read more
In Java if a method wants to return anything then it makes use of return keyword. Let us see important points about it : return keyword can be used return objects, primitive types and expression. We need to specify return type in method signature. It can also be used to return null keyword. In this … Read more
Escape sequence is a character which is preceded by the backslash (\). Compiler has special meaning for escape sequences. Use of Escape Sequences Sometimes we may need to print some text within double quotes or we may need insert a new line in between texts. So these escape sequences were introduced to perform these special … Read more
Strategy and action games are the most engaging games of all. People can play these games for hours and still not get bored. Today I have compiled a list of 6 best free strategy and action games for Android platform : 1. The Pirate: Caribbean Hunt This is a pirate ship game where you command … Read more
ASCII stands for American Standard Code for Information Exchange. ASCII codes are widely used in Computer Science. Let us see how to convert ASCII values to char in Java. ASCII values are basically integer values that can be converted to char value just by typecasting. Let us look at 3 ways to do convert ASCII … Read more
Iterator returned by entrySet() and keySet() methods can be used to iterate a HashMap in Java Let us look at the code for the iterator using both entrySet() and keySet() methods: Output