My Java Learning Class (Original) (2004.9.14-2004.5.14)

xiaoxiao2021-03-06  46

Suddenly there is an idea today, I want to write about my learning process and harvest about myself. Let more Java beginners like me less :) I hope everyone will communicate and support !!!!

Author: Queer Qoo

Java 1st Class ()

Workers must be good, must first take care of them!

What is the program:

1) Input-> Process-> Output

2) Modeling to the real world

What is Java:

Java is not only a language, but also a platform

Development Tools: JDK_1.4.2 Eclipse (a must-choose tool for beginners)

After installing these tools, start the first program example:

The steps are as follows: Edit => Compile => Run

Write the source code with Notepad or other editing tools:

// The source code is as follows.

Public class test {

Public static void main (string [] args) {system.out.println ("Hello, World, I Love Java);}}

Saved as Test.java file after writing, and then

Compilation: Javac Test.java

Run: Java Test

Print Results: Hello, World, I Love Java

First, what is a variable

Variable: memory logo

Name Rules: Digital, Understanding, US Dollar, Unicode Upper

II. Type (strong type)

Boolean (True / Flase)

Char (a letter, a Chinese or any unicode character) 16bit

BYTE value range - 128 to 127

Short-2 ^ 15 to 2 ^ 15-1

INT-2 ^ 31 to 2 ^ 31-1

Long-2 ^ 63 to 2 ^ 63-1

Float 32bit

Double 64bit

// The following source code descriptions The above two points

// Interchange of two variables

Public class test2 {

Public static void main (string [] args) {int a = 5; int b = 7; system.out.println ("a =" a); system.out.println ("b =" b); A = a b; b = ab; a = ab; system.out.println ("a =" a); system.out.println ("b =" b);}}

// maximum and minimum value

Public class test {

Public static void main (string [] args) {system.out.println ("byte:" byte.max_value); system.out.println ("Byte:" byte.min_value; system.out.println (" Short: " short.max_value); System.out.println (" Short: " short.min_value; system.out.println (" byte: Byte.max_Value); system.out.println ("byte: " Byte.max_value; system.out.println (" int: integer.max_value); System.out.println ("INT: Integer.min_Value); System.out.Println (" long: " Long.max_value; system.out.println ("long:" long.min_value); system.out.println ("float:" float.max_value; system.out.println ("float:" float. Min_value; system.out.println ("Double:" doublemax_value); system.out.println ("Double:" double.min_value);}

}

3. Operator

Arithmetic operator: - * /%

Samples:

1 1 = 2 2-1 = 1 2 * 3 = 6 6/2 = 3 3% 5 = 3

Conditional operator: ==! => <> = <=

Relational operator: && || &! | ^ ~

Player: >> << >>>

转载请注明原文地址:https://www.9cbs.com/read-117382.html

New Post(0)