1. in Java, the integer type is converted to the struct type method, integer. tostring (intvalue), and so on.
2. Obtain the file in the relative path:
String filepath = testio1.class. getresource ("Pet. template"). tostring ();
Filepath = filepath. substring (filepath. indexof ("/"), filepath. Length ());
3,
Public class slongte {Private Static final slongte instance = new slongte (); Private slongte () {} public static slongte getinstance () {return instance ;}} public class slongte {Private Static slongte instance; private slongte () {} public static slongte getinstance () {If (instance = NULL) instance = new slongte (); return instance ;}}
4. What is the difference between null and "" in Java?
Null is a keyword that indicates an uncertain object, but it is neither an object nor an object instance.
"" Can be regarded as a value with a length of 0