Tag Archives: Java-Library

ProcessBuilder in Java to create a basic online Judge

We have discussed Process and Runtime to create an external process. In this post, ProcessBuilder is discussed which serves the same purpose. Let us understand an application where we need to get source code and find out the language. The application needs a string (containing source code) as input. The application needs to find out… Read More »

strictfp keyword in java

strictfp is a keyword in java used for restricting floating-point calculations and ensuring same result on every platform while performing operations in the floating-point variable. Floating point calculations are platform dependent i.e. different output(floating-point values) is achieved when a class file is run on different platforms(16/32/64 bit processors). To solve this types of issue, strictfp… Read More »

Java.lang.Character Class in Java

Java provides a wrapper class Character in java.lang package. An object of type Character contains a single field, whose type is char. Creating a Character object : Character ch = new Character(‘a’); The above statement creates a Character object which contain ‘a’ of type char. There is only one constructor in Character class which expect… Read More »

Java.io.DataInputStream class in Java | Set 2

Java.io.DataInputStream class in Java | Set 1 More Methods: byte readByte() : Reads and returns one input byte. Syntax:public final byte readByte() throws IOException Returns: the next byte of this input stream as a signed 8-bit byte. Throws: EOFException IOException float readFloat() : Reads four input bytes and returns a float value. Syntax:public final float… Read More »

java.lang.Character class – methods | Set 2

java.lang.Character class – methods | Set 1 Following methods of Character class are discussed here : toUpperCase() : java.lang.toUpperCase(char arg) method converts given character in argument to its Upper case based on Unicode values. Syntax : public static char toUpperCase(char arg) Parameters : arg : character to be converted to Upper case Return : Upper… Read More »

java.math class and its methods | Set 1

Math class provides mathematical functions to preform basic numeric operations such as exponential, logarithm, square root, and trigonometric functions. cosh, sin, tan, abs, bitLength, multiply and many more. Implementations of the functions of Math class do not return bit-for-bit same results. Hence, perform better implementations. Class Declaration public final class Math extends Object This set… Read More »

Math class methods in Java with Examples | Set 2

java.math class and its methods | Set 1 java.math class methods discussed in this article : abs() : java.math.abs() method returns the absolute value of any type of argument passed. This method can handle all the data types. Special Case : Result is positive zero, if the argument is positive zero or negative zero. Result… Read More »

java.lang.Character class methods | Set 1

lang.Character class wraps the value of a primitive data type – char to an object of datatype char and this object contains single field having the data type – char. This class provides no. of methods regarding character manipulations like convert them from lowercase to uppercase. Character class is based on Unicode Standards to provide… Read More »

util.date class methods in Java with Examples

Following are some important date class methods : .toString() : java.util.Date.tostring() method is a java.util.Date class method.It displays the Current date and time. Here Date object is converted to a string and represented as: day mon dd hh:mm:ss zz yyyy day : day of the week mon : month dd : day of the month… Read More »