Java-related issues

Source: Internet
Author: User
Tags java se

1.JDK and Eclipse directory structure operations
1) Open the JDK directory structure
Pwd
Cd/opt
CD JDK
Ls
2) Open the directory structure of Eclipse
Cd..
CD Eclipse
Ls

Installation and configuration of 2.JDK
Installation
Oracle provides two products for the Java SE platform, one JRE and JDK, available for free download from the official website (http://www.oracle
. com/technetwork/java/index.html).
In addition to downloading the JDK, developers typically download the official Java documentation, which is essential for learning and developing the Java language. The specific Java official documentation
Location on http://www.oracle.com/technetwork/java/javase/downloads/index.html page
Configuration
Bin directory: Used to hold JDK tool commands, such as the Javac command for compiling Java programs, Java commands to start the JVM running Java programs
, the Javadoc command to generate the document, the jar command for packaging, and so on
JRE directory: Used to store the JRE contained in the JDK, which contains the JVM and the core class library;
LIB Directory: the Toolkit (tool APIs) for storing JDK tool commands;
Demo directory: For storing some sample programs;
Src.zip file: The Java source code used to hold the core class library.
Path of the path bin
Path to the Java_home JDK

3. Console version of Java HelloWorld
Use VI to write the Helloworld.java program, after running, in the console output "Hello Word".
VI Helloworld.java
I (make VI into insert mode)
Press the ESC key to go to the command-line mode
: (Enter last line mode)
Wq (Save and Exit VI, back to the terminal interface)
Javac Helloworld.java (Compilation)
Java HelloWorld

4. Brief introduction of Java compiling and running process

5. Terminology explanation JVM, JRE, JDK

6. Implement the console version of Java HelloWorld according to the cookbook documentation

7. Prime number Issues
This case requires the use of interactive form to find all the prime numbers from 2 to a range of values, and output the results. Because the output of prime numbers may be more, require
Output with a maximum of 10 prime numbers per line.
Attention:
Prime number, also known as Prime, refers to the number of natural numbers greater than 1, except 1 and the integer itself, cannot be divisible by other natural numbers.

8. Methods
All languages have the concept of methods, and some speak of them as functions or processes.
method is used to encapsulate a specific logical function
Methods can be called repeatedly in the program;
Methods to reduce code duplication and facilitate program maintenance.

Java-related issues

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.