In learning Java , we all meet a lot of problems, such as:
1. Theenumeration type is a reference type, and the enumeration does not belong to the original data type, and each of its specific values refers to a specific object. The same value refers to the same object.
You can use the "= =" and the equals () methods to directly compare the values of the enumeration variables, in other words, for variables of enum type, "= =" and The result of the Equals () method execution is equivalent.
The inverse code and the complement of positive numbers are the same as the original code;
Negative inverse code, complement and the original code is not the same, negative number of anti-code: The original code to remove the sign bit, the other value of the reverse,0 to 1,1 change 0 , the complement of negative number: its anti-code plus one, and in Java The median is signed, and in the computer operation, it is performed in the form of a complement.
There are fixed scopes in a value, and if the same value is present but given a different domain, an uprising will be reported with the most recent value.
In Java , the conversion from low-precision to high-precision will be a loss-free conversion, and the conversion from high-precision to low-precision when the loss of precision.
It is inaccurate to calculate with a double type of data. Because this involves decimal and binary conversion problems,the N binary can be understood as: the power of the number * cardinality, and the value of the double type occupies 64bit , i.e. - Binary number, except that the highest bit represents the positive and negative sign, and the lowest bit is bound to have an error with the actual data.
Because the first use is the binary value of the calculation, and the second is to add the value of X+y to the value of the given x+y;
Import Javax.swing.JOptionPane;
public class Addition {
public static void Main (string[] args) {
TODO Auto-generated method stubs
String Firstnumber,
Secondnumber;
int Number1,
Number2,
Sum
Ji
Jian
Shang
Firstnumber =
Joptionpane.showinputdialog ("Enter first integer");
Secondnumber =
Joptionpane.showinputdialog ("Enter second integer");
Number1 = Integer.parseint (Firstnumber);
Number2 = Integer.parseint (Secondnumber);
sum = number1 + number2;
Ji = number1 * NUMBER2;
Jian = number1-number2;
Shang = Number1/number2;
Joptionpane.showmessagedialog (
NULL, "The sum is" +sum, "Results",
Joptionpane.plain_message);
Joptionpane.showmessagedialog (
NULL, "The JI is" +ji, "Results",
Joptionpane.plain_message);
Joptionpane.showmessagedialog (
NULL, "The Jian is" +jian, "Results",
Joptionpane.plain_message);
Joptionpane.showmessagedialog (
NULL, "The Shang is" +shang, "Results",
Joptionpane.plain_message);
System.exit (0);
}
}
This program can perform subtraction operations.
Thoughts after Java class