[Novice must read] Java entry and FAQ (transferred from Chinajavaworld)

xiaoxiao2021-03-06  66

I. Getting started 1, download and install J2SDK http://java.sun.com/j2se/1.4.1/download .html 2 java vm 3 API http://java.sun.com/api/index.html

1 First Download J2SDK Installation A Update Path Environment Variable In order to perform Java commands (such as Javac, Java, et al) in any directory, you need to put Java's bin directory into the PATH environment variable. For Windows95 / 98, open the Start menu, select "Run", enter the command sysedit, find the PATH settings in the C: /autoexec.bat window (C: / JDK1. 3.1_01 / bin) For Windows NT and Windows 2000, enter the Start menu, select Set / Control Panel / System. For Windows NT, select the Environment page, for Windows 2000, select "Advanced" page, add in the user variable bar in the environment variable setting (if there is no PATH) or modify the PATH environment variable, make it included in C: / JDK1 .3.1_01 / bin path. B Update ClassPath Environment Variables In order to enable the system to find user-defined classes, you need to place the directory where the user class is located (usually the current directory is added to the classpath) is placed in the ClassPath variable. The specific changes method is used to modify the process, just to find the ClassPath environment variable for modification. Environment variables under jdk win2000 set C Confirm that the system is installed under the DOS prompt, enter the set command to see if the PATH and CLASSPATH settings are successful (if you are 98 need to run autoexec.bat to make the modified setup take effect if it is 2000 Turn the DOS to re-run) 2 and then run your first Java program to write a class saved as .java file must remember if you save the phone editor, you want to save the type for all types and then the file name and your class The name can be exactly the same or you can use the class name .java plus quotes to avoid saving the type .java.txt type.

3 Common Error Processing If you run the javac command, CAN not read xxx.java appears first to see if your file is saved as .java.txt type (the expansion name in the right point file) remember to remember File name. Java plus quotation marks saved. If you run the java command, prompt Exception in Thread "Main" java.lang.noclassdeffounderroe: The exception indicates that you have not joined in your classpath. Second, common mistakes

1 Can not read xxx.java First look at whether your file is saved as .java.txt type (the expansion name in the right point file) Remember to save the file name .java plus quotation marks.

2 Exception in thread "main" java.lang.noclassdefounderroe: indicates that you have not joined in your classpath. http: / / www.chinajavaworld.net/forum/topic.cgi?forum=20&topic=7233

3 Where is the difference between "==" and "equals ()"? http://www.chinajavaworld.net/forum/topic.cgi?forum=20&topic=16630&show= 0

4 StringBuffer S1 = New StringBuffer ("a"); StringBuffer S2 = New StringBuffer ("a"); S1.Equals (S2) // Why is False STRING S1 = New String ("a"); string s2 = new string ("a"); s1.equals (s2) // Why is True string, and stringbuffer difference

5 Java web start? 6 Trim () function usage

7 How to extract the system time?

8 How to let the window always in the first

9 Date Display Format http://www.chinajavaworld.net/forum/topic.cgi?forum= 20 & Topic = 16750 What is the difference between 10 static and non-static nesses?

11 How to judge the input Stuff is the character or a number?

12 finalize () and system.gc () differences 13 How to enter 2 on the keyboard .... Constly printed 50 ??? system.in.read () usage http://www.chinajavaworld.net/forum/topic.cgi?forum=20&topic=4605

15 types of polymorphism

16 If a program contains multiple .java files, and they are associated with each other, now to compile them, what should I do! http://www.chinajavaworld.net/forum/topic.cgi?forum=20&topic=5000< >

17 Interface and Class Discussion

18 How is the Chinese characters turn into code?

19 Can you read JTEXTAREA's content a row?

20 two dates to the string of the string add to add

21 "THIS" function and what is the use? 22 About polymorphism and multi-level inheritance

23 What is an object-oriented design idea?

24 About a problem with the inner class of Java

25 How to get this machine's IP

What is the difference between THROW and THROWS?

27 Why is this problem with an abstract class in Java? ? What is his role? What is the advantages? ?

28 Final, private defines a variable means meaning meaning in meaning in meaning in meaning in meaning in meaning in meaning in meaning in meaning in meaning in meaning in meaning in meaning in ket/topic.cgi?forum=20/10/www.chinajavaworld.net/forum/topic. CGI? Forum = 20 & Topic = 7042 29 Java modifier and character output problem

30 What is anonymous?

31 How to run another executable file on the hard disk in an application?

32 How to take this date ??? I want to get this format: YYYY-MM - DD how to make? ? ?

How to translate 336?

34 How to generate .jar files?

35 Final can inherit the overlay http://www.chinajavaworld.net/forum/topic.cgi?forum=20&topic=25880&show=0


New Post(0)