Summary of cattle brushing questions—java articles

Summary of cattle brushing questions – java articles

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.

& [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
The result is: 00001, that is, the result is 1

public class test{
    public static void main(String[] args) {

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

“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


JVM detailed portal:

Leave a Comment

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