Day8 Java Basics Detail Review

Source: Internet
Author: User
Tags decimal to binary

Java's father--james Gosling

Java mascot--duke

Compile: Source file (. java file)--"java compiler = =". class file

Run: Class loader-"bytecode checker-" Interpreter (Java cross-platform)--"System operating platform

jdk1.2<-->java2.0

jdk1.5<-->java5.0

Three-mesh operator (implicit conversion)

eg

int a=1;

System.out.println (true? ' B ': 100);

System.out.println (true? ' B ': 100000);

System.out.println (true?a: ' B ');

The answers are: B, 98, 98

Constant naming reason: Easy to modify, the business name into the operation, easy to understand.

The _%_ ends are integers, and the resulting positive and negative symbols follow the dividend.

While/for know the number of times with for, do not know with while.

Recursion--is also a loop that allows a method to invoke itself (every time it does, the next time the result depends on the previous time) {useful: decimal to binary}

public static void fun (int num) {
int i=num%2;
num/=2;
if (num!=0) {
Fun (num);
}
System.out.print (i+ "");
}

Day8 Java Basics Detail Review

Related Article

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.