A Experimental content
1. Compiling and running a simple Java program using the JDK
2. Edit, compile, run, and debug Java programs using Eclipse
3. Implement the arithmetic and test.
Two Experimental knowledge points
1. Installation location and difference of JVM, JRE, JDK;
2. command line run JAVAC,JAVA;JAVAC-CP; JAVA-CP;
3. Path,classpath,sourcepath setting method and application;
4. Package management: package;import;javac-d;
5. Eclipse (Netbeans) manages Java projects, debugging: breakpoints, stepping, etc.;
6. Java basic syntax: type and type conversion; variables; operators; Process control, etc.;
7. Use of JDK help documentation;
Three Experiment
1. Caesar
Import java.io.*;
Import Java.util.Scanner;
public class Kaiser {
public static void Main (string[] args) {
System.out.println ("Please enter key:");
Scanner s = new Scanner (system.in);
int a = S.nextint ();
C (a); }
public static void C (int n) {
try{
Char b[];
BufferedReader Br2 = new BufferedReader (new InputStreamReader (system.in));
System.out.println ("Please enter a clear text:");
String Str2=br2.readline ();
B=str2.tochararray ();
System.out.println ("ciphertext:");
int k=n;
for (int i=0;i<str2.length (); i++) {
Char ch= (char) ((b[i]-' a ' +k)%26+ ' a ');
System.out.print (CH);
}
System.out.println ("\ n key k=" +k);
}
catch (IOException e) {
System.out.println (E.getmessage ());
}
}
}
Iv. Summary of the experiment
This experiment is mainly used by scanner, it can let the user enter the key from the keyboard, clear text, the screen will appear ciphertext, to reach the user requirements.
Familiarity of experimental 1:java development environment