Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners conversion from decimal to hexadecimal and vice versa
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


mohammed rafi syed
conversion from decimal to hexadecimal and vice versa
2 Answer(s)      2 years and a month ago
Posted in : Java Beginners


can i get the code for converting decimal to hexadecimal


Advertisement
View Answers

September 12, 2012 at 5:06 PM


Here is a code that converts decimal to hexadecimal.

 import java.io.*;

public class DecimalToHexadecimal{
  public static void main(String[] args) throws IOException{  
  BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
  System.out.println("Enter the decimal value:");
  String hex = bf.readLine();
  int i = Integer.parseInt(hex);
  String hex1 = Integer.toHexString(i);
  System.out.println("Hexa decimal: " + hex1);
  }
}

Here is a code that converts hexadecimal to decimal.

 import java.io.*;

public class  HexadecimalToDecimal{
  public static void main(String[] args) throws IOException{
  BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
  System.out.println("Enter the Hexadecimal number:");
  String str= bf.readLine();
  int i= Integer.parseInt(str,16);
  System.out.println("Decimal:="+ i);
  }
}


September 12, 2012 at 6:50 PM


thank yoy sir.can i get the code without using standard libraries



Related Tutorials/Questions & Answers:
conversion from decimal to hexadecimal and vice versa
conversion from decimal to hexadecimal and vice versa  can i get the code for converting decimal to hexadecimal   Here is a code that converts decimal to hexadecimal. import java.io.*; public class
I converting binary to decimal and vice versa
I converting binary to decimal and vice versa  can i ask for the codes in converting binary to decimal and decimal to binary to be run in one program with repeat.. pls. help me! i badly need the codes by monday!! pls
Advertisements
Java code for conversion between .xls and .xlsx or vice versa - Development process
Java code for conversion between .xls and .xlsx or vice versa  I've some problems in my Project. I'm working on a web based application which... or tool in Java for converting between .xls to .xlsx or Vice versa
decimal to hexadecimal
decimal to hexadecimal  using array in java convert decimal to hexadecimal.   Hi, Please see the example Convert Decimal to Hexadecimal. Thanks
converting From Hexadecimal to Decimal System - Java Interview Questions
converting From Hexadecimal to Decimal System  Write a program in Java user is required to enter a number system XVI and turn it into the decimal.../java/java-conversion/DecimalToHexadecimal.shtml  Hi Friend, Try
hexadecimal conversion java compilation - UML
hexadecimal conversion java compilation  write a simple program...) and converts them to both decimal and hexadecimal as outputs  Hi Friend, Please visit the following links: http://www.roseindia.net/java/java-conversion
Convert Hexadecimal to Decimal
Convert Hexadecimal to Decimal     ... a hexadecimal number into decimal. Code Description: This program takes a hexadecimal...: hexadecimal and 16. It converts a hexadecimal number into a decimal number. 
how to open jdialog form in jinternalframe and transfer data from jdialog to jinternalform and vice-versa - Java Beginners
how to open jdialog form in jinternalframe and transfer data from jdialog to jinternalform and vice-versa  hi....... i am developing simple... dialog frame from jinternalframe any transfering record between jinternalframe
Convert Decimal to Hexadecimal
Convert Decimal to Hexadecimal     ... into hexadecimal. The java.lang package provides the functionality to convert a decimal... a decimal number at console and converts it  into the hexadecimal format using
Java code for converting between .xls to .xlsx and vice versa - Java Beginners
need a solution in Java from which i can upload in MS Excel 2003 and download in MS Excel 2007/2010 or vice versa...Java code for converting between .xls to .xlsx and vice versa  I've
how to convert a text file thats is in russian to english and vice versa using java ?
how to convert a text file thats is in russian to english and vice versa using java ?   Hello, I am a beginner to java, I want to convert a text file which is in english to russian and vice versa Kindly advice me Thanks
Overview of Networking through JAVA,To retrieve the IP address from Host Name, vice-versa
To retrieve the IP address from Host Name, vice-versa... to explain the method to find out the IP address from host name and to vice verse. Here... the host name of that Host. Apart from all of this we put the condition for wrong
how to convert all the pixel value to hexadecimal and from hexadecimal to binary in vb.net
how to convert all the pixel value to hexadecimal and from hexadecimal... is not available so that i selected as java.first i need to store the pixels in 2d array .from that i need to convert all the pixel values into hexadecimal how it can be done
Conversion of Decimal to Binary in Java
Conversion of Decimal to Binary  in Java In this section we will discuss about conversion of Decimal to Binary in Java. You know that number having base 10 is a decimal number, for example 10 is a decimal number which can
Convert Byte to Hexadecimal
into a hexadecimal number. The package java.lang provides the functionality for this conversion. Code Description: This program takes a byte number from console... Convert Byte to Hexadecimal     
To retrieve the IP address from Host Name, vice-versac
To retrieve the IP address from Host Name, vice-versa... to explain the method to find out the IP address from host name and to vice verse. Here... the host name of that Host. Apart from all of this we put the condition for wrong
Data Conversion from double to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from double primitive type to another data type like String, boolean and char etc
Data Conversion from long to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from long primitive type to another data type like String, boolean and char etc
Data Conversion from float to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from float primitive type to another data type like String, boolean and char etc
Data Conversion from short to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from short primitive type to another data type like String, boolean and char etc
Data Conversion from byte to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from byte primitive type to another data type like String, boolean and char etc
Data Conversion from int to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from int primitive type to another data type like String, boolean and char etc
Data Conversion from String to another type
Data conversion is the conversion of data from one type to another type. In this section we will learn about data conversion from String primitive type to another data type like int, boolean and char etc
Java Conversion
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
language conversion from english to arabic in a struts project
language conversion from english to arabic in a struts project  how to convert struts project to arabic language from english language without using... also into english language from arabic language   Please visit
Excel conversion tool. - Java Beginners
Excel conversion tool.  Hi, I need a conversion tool which can convert .xls(Excel 2003) to .xlsx (Excel 2007) and vice-versa. Please suggest any links ro tools. Thank You
Java Temperature Converter
temperature from Celsius to Fahrenheit and vice versa. Here is an example where.... It prints the chart in tabular format and shows the conversion of the Fahrenheit equivalents of all Celsius temperatures from 0 to 100 degrees in 4 degree
String conversion
String conversion  I want to convert a string of mix cases(lower and upper case) to vice versa. ex. HellO should be printed to hELLo. the string comes from user using datainputstream. Also sending individual chars of string
Conversion from color to Gray Image - Java Beginners
Conversion from color to Gray Image  Hi... Sakthi here.. i am new to java. and i haven't try this so far How to convert the color image to gray scale image in java? could u plz help me out to start the process
Convert Binary to Hexadecimal
Convert Binary to Hexadecimal     ... into hexadecimal.  The java.lang package provides the functionality to convert the binary data into hexadecimal.  Description of the program: This program takes
Advertisements
 

 

 

DMCA.com