implement various transformations in the Java language (binary, octal, decimal, hexadecimal, mainly using Java Swing technology)
1, the original question
Enter a hexadecimal number from the keyboard, convert it to a decimal number, and then output.
Today happened to touch a bit or expression, just like you do a binary between the converter, the basic skills are not solid, binary operation between the confused.The common way to do this is binary, octal, decimal, and hexadecimal, and the general
Computer overviewThe basic composition of the computer:
memory : A memory-enabled component used to store computational programs and various data involved in the operation
arithmetic and logic operation of data: processing of data
The format (String format, objece ... argues) function is equivalent to the printf function in the C language, but is relatively flexible. Similar to the printf function in C, a simple substitution effect can be generated when format is used.
1. Type conversion01) Other data types to Boolean type conversionsConvert by Boolean () function"Boolean true false"String non-empty Strings ""Number any non 0 0 and NanObject NULL for any objectsUndefined N/a Undefined (n/a not applicable not
Final Preview
Let's look at the final preview effect
The first step: what does the binary mean?
Everyone knows how to count, but not everyone knows how many different methods there are. Now we're going to use a very special method called the
%1 $ s indicates that the first replacement location is placed as a string type such as System.out.println (String.Format ("%1 $ s Hello%2$s", "XXX", "!")); The output is "XXX Hello!" String.Format after the first argument is an expression, can be
Turn from: Use of Java string Formatting-string.format () (GO)Formatting of regular typesThe format () method of the string class is used to create a formatted string and to concatenate multiple string objects. Students familiar with C language
Formatting of regular typesThe format () method of the string class is used to create a formatted string and to concatenate multiple string objects. Students familiar with C language should remember the C language of the sprintf () method, the two
1. VariablesNaming rules:A can only be a letter (A-Z), Number (0-9), underscore (_)b cannot start with a numberc cannot be a keyword in C #Naming conventions:A short, semantic word or combinationB Camel nomenclature (start with the second word,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.