- Experiment name
Environment construction and Java program development
- Experiment purpose and requirements (knowledge points involved and required to be mastered in this computer experiment)
1. Understand the development history of Java;
2. Be proficient in the operating principles of Java programs;
3. Proficient in setting up Java environment;
4. Be proficient in the composition and development of Java programs.
- Experimental environment (the platform and related software used in this computer practice)
Multimedia microcomputer; Windows, jdk and Eclipse.
- experimental design
- Experiment content
(1) Search the Internet for information to understand the origin and development history of Java.
(2) Practice using common MS-DOS commands. Master the use of the following commands: dir, cd, javac, java, set, etc.
(3) Download and install jdk, and complete the environment setup.
(4) Develop a Java application separately and use the output method to output "East China Jiaotong University Welcome!"; set the string to be output as a variable and then output it; create a new class and set the string to be output to this Class attributes, use the main class method to create a new class object and implement string output.
- Experimental steps
- Program 1
package shiyan1;
public class shiyan1 {
public static void main(String args[]) {
System.out.println("CSDN欢迎您");
}
}
- Program 2
package shiyan1;
public class shiyan2 {
public static void main(String args[]) {
String m="CSDN欢迎您";
System.out.println(m);
}
}
- Program 3
package shiyan1;
public class shiyan3 {
public static void main (String args[]) {
System.out.println(Second.Message);
}
}
class Second{
static String Message="CSDN欢迎您!";
}