Convert Decimal into Binary In this section, you will learn to convert decimal number into binary. The java.lang package provides the functionality to convert a decimal number into a binary number.
Java Conversion
In this section we are going to learn about the type conversion in Java. The term Type Conversion is Java is used for the coding process where are converting one data type into another data type. For example in the web application use can type product quantity in a text field and then data is sent to server in the String format. After retrieving the data into a String variable we can only use this in number format after the conversion of String into number.
The data conversion is necessary process in programming because one data format is different another format. For example number 10 is String can't be compared with number 10 in a Integer variable. So, in this section we are going to give you many Java Conversion examples with explanation.
Here we have given more than 50 examples of Java Conversion with detailed explanation. Here are examples:
- Convert Decimal into Binary
In this section, you will learn to convert decimal number into binary. The java.lang package provides the functionality to convert a decimal number into a binary number.
-
Convert Decimal to Octal
In this section, you will learn to convert a decimal number into a octal number . -
Convert Decimal to Hexadecimal
In this section, you will learn to convert decimal data into hexadecimal. The java.lang package provides the functionality to convert a decimal number into hexadecimal. -
Convert Binary to Decimal
In this section, you will learn how to convert binary number into decimal. The java.lang package provides the facility for converting the data integer into the binary to decimal. -
Convert Binary to Hexadecimal
In this section, you will learn to convert binary data into hexadecimal. The java.lang package provides the functionality to convert the binary data into hexadecimal. -
Convert Octal to Decimal
In this section, you will learn to convert an octal number to decimal. The following program helps you converts number octal to decimal. -
Convert Hexadecimal to Decimal
In this section, you will learn to change hexadecimal number into decimal. The java.lang package provides the functionality to convert a hexadecimal number into decimal. -
Convert Hexadecimal number
into Integer
In this section, you will learn to convert hexadecimal data into integer. The java.lang package provides the functionally to convert the hexadecimal data into an integer type data.
-
Convert
Hexadecimal into Binary and Long
In this section, you will learn to convert the hexadecimal data into the binary and long format. The java.lang package provides the functionality to convert a hexadecimal to binary and long type data.
-
Convert an Integer into
a String
In this section, you will learn to convert an integer type data into a string type. The java.lang package provides this conversion functionality through toString() method.
-
Convert a String into an
Integer Data
In this section, you will learn to convert a string type data into an integer type. The java.lang package provides the functionality to convert the string type data into an integer type data.
-
Convert a Character into
the ASCII Format
In this section, you will learn to convert a character data into the ASCII format. The java.lang package provides the functionality to convert the character data into the ASCII format
-
Convert Character into
Integer
In this section, you will learn to convert the character into a integer. The java.lang package convert provides the facility to convert the character data into an integer type.
-
Alphabet Character
Case-Converter
In this section, you will learn to convert a character (uppercase) into a lowercase character. The java.lang package provides the functionality to convert the uppercase character into a lowercase character.
-
Convert Character into a
String
In this section, you will learn how to convert a char into a string type data. The java.lang package provides the functionality to convert a character into a string.
-
Convert String to Date
In this example we are going to convert string into date. -
Convert Date to Calendar
In this example we are converting date into Calendar. Here we are using format method to convert date into string. -
Convert Date to Milliseconds
In this example we are converting date into milliseconds. In this example we are using getTime() method to get time/date as long return type. -
Convert Date to Long
In this example we are converting date into long. In this example we are using getTime() method to get time/date as long return type. -
Convert Date to String
In this example we are converting date into string. In this example we are using format method to convert date into string. -
Convert String to Calendar
In this example we are converting string value into Calendar. -
Convert Millisecond to Date
In this example we are converting Milliseconds into Date. -
Convert Date to Timestamp
In this example we are converting date into a timestamp format. -
Convert Long to Date
In this example we are converting Long value into Date. -
Convert Date to GMT
In this example we are converting date into GMT. -
Convert InputStream to Byte
In this example we are going to convert input stream to byte. Here we are going to read input stream and converting it into bytes. To do so first read the input stream from dos prompt then store it into an integer. Finally type cast the integer value into byte. -
Convert Inputstream to Bufferedreader
In this example we are going to convert Inputstream to Bufferedreader. -
Convert Inputstream to Outputstream
This discussion shows how to convert an InputStream to OutputStream. Here we are trying to make understand the conversion of an input stream into an output stream by taking an example. -
Convert InputStream to ByteArray
Here we will learn the conversion of an input stream into a byte array. -
Convert InputStream to ByteArrayInputStream
In this example we are going to convert InputStream to ByteArrayInputStream. -
Convert Inputstream to File
Here we are showing how to convert an InputStream to File. -
Convert String to Date
In this example we are going to convert string into date We are creating DateFormat by using SimpleDateFormat . -
Convert Char to Byte
This section illustrate the conversion from char to Byte. Here, we are going to convert a char type variable into byte type variable . -
Convert Double to String
This is a simple program based on the package java.lang. This section learns you the conversion of double into string. -
Convert ArrayList to Array
This is a simple program of java util.package. In this section, you will learn how to convert an Arraylist into an array. 0 -
Convert Byte To Hexadecimal
In this section, We are going to convert a byte value into a hexadecimal number. The package java.lang provides the functionality for this conversion. -
Convert Boolean to
String
In this section, we are going to convert a Boolean type data into a string.
-
Convert Decimal to
Integer
In this section, you will learn to convert a decimal number into an integer. The java.lang package provides the functionality to convert a decimal number to an integer type number.
-
Convert Float into Integer
In this section, we will learn to convert a float type data into an integer.
-
Convert Integer to
Double
In this section, you will learn to convert an integer into a double. The the java.lang package provides the functionality for converting an integer type data into a double.
-
Convert Integer to Float
In this section, you will learn to convert an integer type data into a float. The following programs helps you in converting an integer into a float type data.
-
Convert Long To Byte
In this section, we are going to convert a long type data into a byte. The following program provides you the functionality to convert into a long to byte.
-
Convert String To Long
In this section, we are going to convert string to long. The following program provides a functionality to convert a string data (integer) into a long type data.
-
Convert Object to Int
In this section, we are going to learn to convert a numeric string type Object into a primitive type int and Integer Object to primitive type int. .
-
Convert Object to Double
In this section, we are going to convert an object type data into a double.
-
Convert Object To String
In this section, you will learn to convert an object to a string. Object is a class of java.lang package.
-
Convert String To
Float
In this section, you will learn to convert a numeric type string value into a float.
-
Convert String To Double
In this section, we are going to convert a numeric type string value into a double. The double supports big-integer value.
-
Convert Number to Binary
In this section, you will learn to convert a number to a binary (0,1). The given number is a decimal format and the following program to calculate its binary.
-
Convert
Decimal to Charater
This is the simple program of java.lang package. In this example, we are going to convert decimal number to its corresponding character.
-
Convert
Decimal to Fraction
In this example, you will learn how to convert decimal number to Fraction. The following program you convert it into the decimal to fraction value by using doubleValue() method.
-
Convert
Hexadecimal to Character
In this example, you will learn how to convert hexadecimal to char number. The following program provides you convert it into the hexa to char number.
-
Convert Number
to Word
In this example, We are going to convert number to words.
-
Degree Converter
In this example, you will learn how to convert degree to Celsius, Celsius to Fahrenheit, Fahrenheit to Celsius, Celsius to Kelvin, and Kelvin to Celsius.
-
Convert Text to
Html
In this section, We are discussing the conversion of text into html file .This program functionally provides you converting text to html file by using FileOutputStream. The FileOutputStream() is a constructor.
-
Convert Text to
word
In this example, You will learn how to convert text to word file. Here, we are going to discuss about the conversion of text to word file.
-
Convert Array to List
In this section, you will learn to convert an Array to List. This program helps you in converting an Array to List.
-
Convert Array to Vector
In this section, you will learn to convert an Array to Vector. This program helps you in converting an Array into a Vector.
-
Convert Collection to Array
In this section, you will learn to convert Collection data to an Array. This program helps you in converting Collection data to an Array.
-
Convert Vector to Array
In this section, you will learn to convert Vector to an Array. This program helps you in converting Vector to an Array.
-
Convert Text To Binary
In this section, we will learn how to convert Text to Binary. The following program provides you the functionality to convert Text to Binary.
-
Convert Number to String
In this section, we will learn how to convert numbers to String. The following program provides you the functionality to convert numbers to String.
-
Convert String to Number
In this section, we will learn how to convert String to Number. The following program provides you the functionality to convert String to Number.
-
Convert charArray to String
Lets see how to convert charArray to String.
-
Convert List to ArrayList
In this section, you will learn how to convert List to ArrayList.
-
Convert Time to Milliseconds
In this section, you will learn to convert Time to seconds. An hour has 3600 seconds, a minute has sixty seconds and a millisecond is one thousand part of a second i.e. an unit for measuring the time.
-
Convert Time to Seconds
In this section, you will learn to convert Time to seconds. An hour has 3600 seconds and a minute has sixty seconds.
-
Convert GMT to CST
In this section, you will learn to convert a GMT to CST format. The GMT stands for Greenwich Mean Time and CST stands for Central Standard Time.
-
How to convert a stack trace to a string?
Learn to convert StackTrace object data into String object.