Java the next day

Source: Internet
Author: User

1.Hello World
public class Hello {
public static void Main (string[] args) {
System.out.println ("Hello, world!");
}
}
This program expresses the meaning of Hello world! Public is open, class is the meaning of classes, in Java is written into a class, hello represents the file name, the first curly brace represents the beginning of the class, and the last curly brace indicates the end of the class,
Static, void, indicates that no feedback is required after the program is finished, main means the eyebrow method, and the curly braces after (string[] args) denote the beginning of the eyebrow method, with curly braces at the end of the eyebrow method.
System.out.println ("Hello, world!") ; out represents the output, print NL it represents the wrapping.



2.import Javax.swing.JOptionPane;

public class Hi
{
public static void Main (string[] args) {
Joptionpane.showmessagedialog (null, "ni");}}

Pop-up Window String dialog box program.



3.import Javax.swing.JOptionPane;

public class Hi {

public static void Main (string[] args) {
String name = Joptionpane.showinputdialog (NULL, "Please enter your name");

Joptionpane.showmessagedialog (NULL, "Are you a monkey-invited tease?") +name);
Joptionpane.showmessagedialog (NULL, "yes");
}}
Pop-up Input dialog box program.

Java the next day

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.