Java Conversion

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

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

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:

  1. 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.
      
  2. Convert Decimal to Octal
    In this section, you will learn to convert a decimal number into a octal number . 

  3. 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.

  4. 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. 

  5. 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. 

  6. 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. 

  7. 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.

  8. 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. 
      
  9. 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. 
     
  10. 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.
     
  11. 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.
     
  12. 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
      
  13. 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.
     
  14. 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. 
     
  15. 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. 
     
  16. Convert String to Date
    In this example we are going to convert string into date. 

  17. Convert Date to Calendar
    In this example we are converting  date into Calendar. Here we are using format method to convert date into string.  

  18. 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.

  19. 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. 

  20. 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. 

  21. Convert String to Calendar
    In this example we are converting  string value into Calendar. 

  22. Convert Millisecond to Date
    In this example we are converting  Milliseconds into Date.   

  23. Convert Date to Timestamp 
    In this example we are converting  date into a timestamp format.

  24. Convert Long to Date 
    In this example we are converting  Long value into Date.   

  25. Convert Date to GMT
    In this example we are converting  date into GMT.    

  26. 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.    

  27. Convert Inputstream to Bufferedreader
    In this example we are going to convert Inputstream to Bufferedreader.

  28. 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. 

  29. Convert InputStream to ByteArray
    Here we will learn the conversion of an input stream into a byte array.

  30. Convert InputStream to ByteArrayInputStream 
    In this example we are going to convert InputStream to ByteArrayInputStream.

  31. Convert Inputstream to File 
    Here we are showing how to convert an InputStream to File.

  32. Convert String to Date
    In this example we are going to convert string into date We are creating DateFormat   by using SimpleDateFormat .

  33. 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 .

  34. 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.

  35. 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

  36. 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.

  37. Convert Boolean to String
    In this section, we are going to convert a Boolean type data into a string. 
     
  38. 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.
      
  39. Convert Float into Integer
    In this section, we will learn to convert a float type data into an integer. 
     
  40. 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.
     
  41. 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. 
     
  42. 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.
     
  43. 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. 
      
  44. 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. .
     
  45. Convert Object to Double
    In this section, we are going to convert an object type data into a double. 
      
  46. 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.
      
  47. Convert String To  Float 
    In this section, you will learn to convert a numeric type string value into a float. 
      
  48. 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. 
      
  49. 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.
     
  50. 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.
     
  51. 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.
      
  52. 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.
     
  53. Convert Number to Word
    In this example, We are going to convert number to words.
      
  54. 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.
     
  55. 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.
      
  56. 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.
      
  57. 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.
      
  58. 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.
      
  59. 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.
      
  60. 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.
      
  61. 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.
      
  62. 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.
      
  63. 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.
      
  64. Convert charArray to String
    Lets see how to convert charArray to String.
      
  65. Convert List to ArrayList
    In this section, you will learn how to convert List to ArrayList.
      
  66. 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.
      
  67. 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.
      
  68. 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.
     
  69. How to convert a stack trace to a string?  
    Learn to convert StackTrace object data into String object.