<> study java My first class

study java Before, first Meet us java Grandmaster —>

James · Gosling

<> Let's introduce our grandmaster –

Here is just an introduction java The origin of , Specific Baidu search Oh

Arrive after graduation IBM work , Design IBM First generation workstation NeWS system , But it's not taken seriously . Later, it was transferred to Sun company .1990 year , And Patrick Naughton and Mike
Sheridan And so on “ Green Plan ”, Later developed a language called “Oak” this Oak namely java It's the forerunner of the world It is said that our grandmaster preferred coffee at the beginning
However, there is an island rich in coffee called “ Zhaowa Island ” So grandmaster is homophonic java However, the older generation also yelled java For claw hollow
But more about it After all, Baidu has it !!

<> Now let me show you again java Influence on the world

According to this diagram It can be seen that java( Our point is java Oh, no matter what else ) Even if it goes down 6% , however java still Top three
. therefore java No matter where it is, it is still a strong programming language
Picture from –TIOBE

<> For compilers

Compiler due to the installation involved And so on It may violate the rules, so I won't introduce it here , Recommend Bili bili There's a guy on the table called < Big brother VV6> Of up main There is an introduction on the home page

<> Opening the first chapter Hello World !!! The world is beautiful ! Wish you a better tomorrow come on.

without demur Code first ————————————————————
public class HelloWorld{ public static void main(String[] args){ System.out.
println("Hello World!!"); } }
First, define a public Of class (class class No matter it's again java still c++ They all mean class You should know )HelloWorld Is the class name It's also our file name
In a java In the file , There is only one public Class of
public static void main Define main method stay java in Functions are called methods ( Everyone is from c Come here )
public static void main(String[] args)
Access modifier qualifier Method The name of the method ( parameter list )
stay java in The bracket of the array should be put together with the variable type
System.out.println(“Hello World!!”);
This is an output format println Output for line feed ( Non format output Let's get to know At the end of this blog, I will introduce you printf print println
What's the difference )
The access modifier qualifiers are :
public
private
ptrtected
Because it's the first class But tell me more

<> Run the code

Early learning suggests using Notepad to complete the code cmd To execute Let yourself understand javac to java Function of command !!

Look at the picture utilize javac Instructions can generate a .class Bytecode file for We don't understand the information in the bytecode file He's for machines This process is called compile
Step two utilize java instructions We can generate what we want HelloWorld!! It's over Amazing ? This step is called running But I've introduced more
unstudied b station 《 Big brother vv6》
come on. There will always be a place for us in the future programming industry

<> Compare three outputs

I am here Introduction only No additional graph Because learning programming must be hands-on in order to let oneself know more
print For output such as We defined one before int a = 20; When outputting, you just need to print(a); that will do finish writing sth. print("%d",a); It's not allowed
After all, it's not called formatted output
printf Format output for such as We defined one before int a = 20; When outputting, you just need to print(“%d”,a); that will do finish writing sth. printf(a);
It's not allowed Because it's called formatted output
println Wrap the output It's just that print Add a new line on the basis of

<> About Xiaobian

Xiaobian is just a freshman QQ be entitled as :2206730228
Welcome to harass Discuss the secret of programming together . In addition, Xiaobian is a rural person. Don't bully Xiaobian. He doesn't know anything

Technology