Summary of cattle brushing questions—java articles

Summary of cattle brushing questions – java articles

1
Switch statement control can be int, short, long, char, string. Integer type, [enumeration type]
cannot be float, double, [boolean] type
It is worth noting that: the constant value behind the case can only be byte short char int enumeration (5.0 and later versions) String (7.0 and later versions), other data types are not allowed, and in the same switch statement, the constant values ​​in all case clauses are different from each other.

2
& [operator] – result of 13&17

Convert two numbers to [binary] , starting with the most significant bit.
The AND operation is performed from left to right, both are 1, and the result is 1
13:01101
17:10001
The result is: 00001, that is, the result is 1

public class test{
    public static void main(String[] args) {
      System.out.println(13&17);
    }
}

3
Cross-platform features of the Java language: The
java program runs on the jvm, which shields the difference of the underlying operating system . The compiler compiles the .java file we wrote into a .class bytecode file and runs it on the JVM

4
“Thread Private” and “Thread Shared” in JVM

Private thread area:
program counter, virtual machine stack, native method stack.
Shared thread area:
java heap, method area

Attached:

JVM detailed portal:

Leave a Comment

Your email address will not be published. Required fields are marked *