Eclipse Create Java Project program

Source: Internet
Author: User

1. First, open eclipse, and in the toolbar, click "File" >>> "New" >>> "Java project">>> Enter the name of the project (other default is OK) > >> "Finish"

2. Right-click on the "src" Directory of the project, then select "New" >>> "class" to create a new Java class, enter the name of the created class, and pay particular attention to the creation of the Main method.


3. The test code is as follows

Package test01;
Use of the String class
public class Test01 {


public static void Main (string[] args) {
TODO auto-generated Method Stub

String str1= "Wangwang";
String str2= "Wangwang";

SOP (Str1.charat (3));char charAt (int index) returns the char value at the specified index
SOP (Str1.compareto (STR2));//int compareTo (String anotherstring) compares two strings in a dictionary order
SOP (Str1.comparetoignorecase (STR2));//String Tiger drop case size after comparison size
}

Simplifies operation by changing the output function to call form
public static void Sop (Object obj) {
System.out.println (obj);
}


}

4. Right-click anywhere in the Java class and select "Run as" >>> "Java application" one at a time, meaning to run as a Java class, and here is the message from the console output. We successfully completed the creation of a Java project and compiled a Java class.


Eclipse Create Java Project program

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.