Lesson One 2018-04-17  19:50:35

JAVA Language features : A compiled 、 Strong type language . A pure object-oriented language , All code must be included in class Method in

To configure JAVA environment variable

1. install JDK
2. My computer ---> attribute ---> Advanced system setup ---> senior ---> environment variable
3. Find... In the system variable "PATH"---> edit
4. take JDK Medium bin The installation path of the folder can be added
for example :D:\Java\jdk1.8.0_91\bin ( Absolute path )
JAVA_HOME = D:\Java\jdk1.8.0_91 %JAVA_HOME%\bin ( Relative paths )

1. A source file ( With JAVA ending ) There can be multiple classes in .
2. Only one class can be declared as public( There can be no ), At the same time, the name of this class should be consistent with the name of the source file .
3. Class can have a main method ( namely main() Method ), Fixed format : public static void main(String[] args){}
4.main() The way to do this is through the program portal , Inside the method is the executive part of the program .
6. The statement ends with a semicolon .
7. Execute program first JAVAC Command compilation , Generate multiple .class Bytecode file . Reuse JAVA The command runs .

summary :.java Source file —(javac)—>.class file ( Bytecode file )

Variable :
1. A storage area in memory .
2. The area has its own name ( Variable name ) And type ( data type )
3.JAVA Each variable in must be declared first , After use !
4. Data from this area can be found in The same type The scope is constantly changing

Use of variables :
Scope of variable : a pair {} In between
initialize value ( There must be initialization )
Define the format of the variable :
data type Variable name = initialize value
Variables access this area by using the variable name

Classification of variables :
1. Basic data type :
plastic :

int(4B) ( Default type )
long(8B) When defining, the value is added at the end "L" or "l" for example : long a = 123L;

Floating point :

double(8B)( Default type )
float(4B) When defining, the value is added at the end "F" or "f" for example :float b = 123.123

Character :

char; It can only mean One character ( english , chinese , Escape character , Symbols, etc. ).
char c = '\n';

Boolean type :

boolean The value can only be true/false It can't be taken as nulll The default is false 
boolean b1 = true;
boolean b2 = false;

Operations between variables :
( Don't consider boolean be left over :char(ascii value /unicode value ) byte short int long float double)
1. Automatic type conversion : When the data type with small capacity is operated with the data type with large capacity , The data type with small capacity will be automatically converted to the data type with large capacity .
    Such as : int a = 10; double b = 10; char c = 'a'; d = a+b+c Finally double type .
    When byte short char When you do an operation between , The result is int type .

2. Cast : The big one is converted into the small one , To use cast characters .( data type ) Variable example :double a = 123; int b = (int)a; 
    Possible problems : Resulting in loss of accuracy

3. Operation between string and basic data type : It can only be a join operation Other data types operate with it , The result is also a string !
    example : String a = "abcd"; double b = 1234; System.out.println("a+b"); result :abcd1234( String type )


Original code : Binary code of primitive number , Inverse code : Each bit of the original code is negated ( Except symbol bit ), Complement code : Counter code plus 1

For positive numbers : Original code , Inverse code , Complement code Three yards together 1

For negative numbers : It's stored as a complement

summary : Whether it's positive or negative , At the bottom, they are all stored in the form of complements

1 public static void main (String[] args){
2 System.out.println("Hello World!");
3 System.out.println("I'm coming!");
4 }

JDK install 、 Variable 、 More articles on the classification of variables

  1. jdk install Environment variable configuration

    The right choice Computer → attribute → Advanced system setup → senior → environment variable 1. System variables → newly build Variable name :JAVA_HOME A variable's value :( Variable values fill in your jdk Installation directory , For example, I am C:\Program Files\Java\ ...

  2. java Development environment construction (jdk install ) And frequent problems

    In the face of many java Beginners environment building problems First step : 1, First of all, Baidu can jdk Get into oracle You can also access this website https://www.oracle.com/technetwork/java/j ...

  3. jdk Installation and environment variable configuration

    JDK yes  Java  Software development kit of language , Mainly for mobile devices . On embedded devices java Applications .JDK As a whole java The core of development , It contains JAVA Operating environment ,JAVA Tools and JAVA Basic class library . jdk Download to ...

  4. jdk Installation and environment variable configuration

    jdk The installation and configuration of environment variables are done every time the environment is changed , But I didn't really think about how I did it every time , Anyway, every time I open Baidu search, I just do it . This time, sort it out , And by the way, sort out the principle . 1. The first step, of course, is to download jdk, What I download here is jd ...

  5. linux see java jdk Installation path and setting environment variables

    One : View type windows: set java_home: see JDK The installation path java -version: see JDK edition linux: whereis java which java (java perform ...

  6. Java Learn the first step -JDK Installation and Java Environment variable configuration

    Java Learn the first step ——JDK Installation and Java Environment variable configuration [ original text ]  2014-05-30 9:09  Java SE   A Chao   9046 views Java As a mainstream programming language , Study Java My friend ...

  7. Titanium series -- install Titanium Studio Medium Android SDK,JDK And the configuration of environment variables ( Two )

    Ubuntu Installation configuration JDK 1. Go first  Oracle download Linux Under the JDK Compressed package , I downloaded it jdk-8u25-linux-x64.tar.gz file , After the next good direct decompression Step1:# Will unzip OK jdk1. ...

  8. Windows In the environment JDK Installation and environment variable configuration detailed graphic tutorial

    Original author :souvc The source of the blog :http://www.cnblogs.com/liuhongfeng/p/4177568.html Content of this section :JDK Installation and environment variable configuration Here are the detailed steps One . The preparation of the instruments : 1 ...

  9. JDK install Configure environment variables

    I will JDK Installed in the D Plate stay D Create a new file in the disk The file named JAVA function jdk Install the software change jdk The installation path is next step wait for jdk installation is complete install jre route jre Change the path to Click next wait for jre installation is complete notes ...

Random recommendation

  1. java Gather to learn one

    Let's look at it first java Graph of sets 1.1 From a comprehensive understanding of Java The set diagram of . Common collections  list  set map And so on, one of the most common list  map combination . Let's talk about the common ones in a few days map.map In the two years I worked ...

  2. SQL、LINQ、Lambda Three uses

    SQL   LinqToSql   Lambda 1.  Inquire about Student All the records in the table Sname.Ssex and Class Column .select sname,ssex,class from studentL ...

  3. Make iis Auto install package

    original text : Make iis Auto install package MS There have been no independent installable IIS Installation package ,Windows The default installation of does not install it , It's usually to the control panel " add to / Delete Windows Program " Select Install from ...

  4. Hadoop Installation ( Log four )

    Last one :SSH Password free ( Journal three ) 1, Get into conf Catalog , Check all the files 2, The first change is hadoop-env.sh The file of , To configure javahome The address of 3, The second is configuration core-site The file of , Including pro ...

  5. Database index ------B-Tree Index and Hash Index comparison

    about B-tree and hash The understanding of data structure can help to predict the difference of query performance using different indexes under different storage engines , Especially those that allow you to choose B-tree perhaps hash Index memory storage engine . B-Tree Indexed ...

  6. Spark Transformation and action of (transformations and action)

    //********************** Installation and replacement operation ********************* 1.def map[U: ClassTag](f: T => U): RDD[U]    take ...

  7. python Reptiles pandas

    One . brief introduction : Python Data Analysis Library or pandas Is based on NumPy A tool of , The tool is created to solve data analysis tasks .Pandas A large number of databases and some standard data models are included ...

  8. P1057 Passing games dp

    Title Description In PE class , Xiaoman's teacher often plays games with his classmates . This time, , The teacher takes the students to play the passing game together . The rules of the game are like this :nn Three students stand in a circle , One of the students is holding a ball in his hand , When the teacher blows the whistle, he starts to pass the ball , Every ...

  9. Ionic App The problem of embedding external web pages in

    stay app It's inevitable to refer to a third-party page in , So in Ionic How can we achieve this in China ? 1. Design references to external pages html Frame page , branch 3 part , The meter head has 2 Button , In the middle is the referenced page , Hide the share button at the bottom , The specific page is as follows : &l ...

  10. Print array all permutations python

    I am .net a , Recently, I'm looking at data structure and algorithm analysis , Some interesting algorithm problems involved in the middle , Intended use python Realize the following . choice python Why , I just want to get familiar with python The grammar of , and pycharm Basic applications . This article ...