For Java, classes are like .... Classes (the difference between objects and classes is like the "human" category and the difference between a single person). (Java class is not a function, and JS is not the same).
Java needs to create an instance in order to execute the program.
Import acm.graphics.*; Introduce a Java mapping package (cartography is like a blank sheet of paper sticking pictures {a bit like PS, probably also layered})
In Java, variables are defined, different types of data are loaded in different boxes. And JS var and let are different.
Give a chestnut: int x = 27;
Variable: {name:xy First Letter _ | | Letter//this is box X
{value:27//what ' s inside the box is a poisoned green apple
{type:int//It can only contain integers, and are always used to count
Other box type: bouble (double precision floating point), Boolean,char (characters)
About constants:
private static final bouble pi= 3.141592;
The only constant that is shared within a private class that is not changed is a double-precision floating-point number type called Pi with a value of 3.141592.
/ * When I used to learn JS, I was not quite sure why I had to shut down the packet, probably Java is more suitable for the first computer language. more systematic, so more simple * /
A class extends object by default. (Just as JS all function is Object)
Public:you can call contents inside a class from the other classes. (Kind of like in a globle scope)
Private:you can call the content is only from method inside the class.
protected : You can call the content inside of a class and its descendents
Learn the Art and science of Java