1. 1 byte occupies 8 bits (that is, 1 byte occupies 8 bits)
1char occupies 16 bits (that is, 1 character occupies 16 bits)
Boolean only occupies 1 digit
2. Use the javadoc command to generate the javadoc File
Use/in the class /**
*
*/
Before class code, you should add class comments to describe some attributes of the class, such as class name, programmer, programming time, and class encapsulation features,
For example, the annotation before the class can be
/**
* Title: Test class <br> // <br> it indicates that the new line breaks by carriage return, making the generated document interface beautiful. If the @ sign is displayed, the end of the line breaks automatically. <br>
* Description: a simulated engineer's class <br>
* Copyright: (c) 2003 www.baidu.com
* Company: IT people Information Exchange Network <br>
* @ Author liubin // author
* @ Version 1.00 // version
*/
Annotation before Method
/**
* This is a function of the Test class object.
* @ Param name Test // name indicates the parameter Test in the method.
*/
Comments on methods with returned values
/**
*
* @ Return description of the returned value
*/
Next, generate the javadoc annotation file. Assume that the sample program Test. java is stored in the C directory, enter the directory where Test. java is located in the command line window, and then run the following command:
Javadoc-d testdoc-version-author Test. java // Where-d is used to specify the name of the generated folder, that is, the javadoc file to be stored is followed by the version information and author information added to the description document.
For more details about javadoc usage, run javadoc-help in the command line window.
3. in java, you can use the following code to read a number entered from the keyboard.
System. in. read (); // wait for user input when the code is running.
String s = JOptionPane. showInputDialog ("enter a value"); // This line of code will pop up a dialog box prompting the user to input through the keyboard
Enter the following code for the displayed User:
Byte buf [] = new byte (1024 );
System. in. read (buf); =
String string = new String (buf, 0); // convert buf to String object string (that is, convert ASCII to Unicode)
Int keyint = Integer. parseInt (string. trim ());
4. The final keyword is added before constants in java;
5. Static ---- static
Non-static --- static or non-static