???? ??? ???? ??? ????? ??? ??????
1. ??? ?????? ???? ? ????.
class A { private String msg="Try to access the private variable outside the class"; // 用 private 修飾,無法別的類調(diào)用,只能在這個類中被調(diào)用 } public class PrivateExample { public static void main(String[] args) { A a=new A(); System.out.println(a.msg); } }
?? ????: java ?? ??
運行結(jié)果:(報錯) Exception in thread "main" java.lang.Error: Unresolved compilation problem: The field A.msg is not visible
2 ?? ??? ? ?????? ??? ? ????.
private class PrivateExample { // private 是不能用來修飾類的 void display(){ System.out.println("Try to access outer private class"); } public static void main(String[] args) { PrivateExample3 p=new PrivateExample(); p.display(); } }
運行結(jié)果:(報錯) Exception in thread "main" java.lang.Error: Unresolved compilation problem:
3. class
private ???? ?? ? ???? ??? ???? ?? ??? ??? ???? ??? Java?? ??? ???? ???? ??? ????.
import java.lang.reflect.Method; class A { private void display() { System.out.println("private method is invoked"); } } public class PrivateExample { public static void main(String[] args)throws Exception { Class c = Class.forName("A"); // 加載 A 類 Object o= c.newInstance(); // 實例化對象 Method m =c.getDeclaredMethod("display", null); // getDeclaredMethod方法返回指定方法,"display" 就是指定方法,null 表示該方法的參數(shù) m.setAccessible(true); // setAccessible 方法能在運行時壓制 Java 語言訪問控制檢查,從而能任意調(diào)用被私有化保護的方法 ( Method ),域 ( Field )、構(gòu)造方法 m.invoke(o, null); // invoke方法來執(zhí)行對象的某個方法,括號中的 o 是方法,null 是參數(shù) } }
運行結(jié)果: private method is invoked
?? ?? ??? ????: java ??? ????
? ??? Java?? ?? ???? ???? ??? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JDBC ????? ???? ????? ?? ?? ?? ??? ?? ?? ??? ?? ? ?? ??? ?? ?? ?? ??? ???????. 1. ????? ????? Conn.SetAutoCommit (False)?? ??????. 2. ??? ? ????? ?? ?? SQL ??? ?????. 3. ?? ??? ??? ?? Conn.commit ()?? ???? ??? ???? ???? ?? ??? ???? Conn.Rollback ()?? ??????. ???, ? ??? ???? ????, ??? ???? ????, ?? ??? ??? ?? ??? ??? ???? ? ???????. ?? ?? ?? ???? ????? ??? ???? ?? ?? ???? ???? ??? ????? ?? ??? ??? ? ?? ???? ?? ????.

thejvmenablesjava? "WriteOnce, Runynywhere"??? ?? excodecodethroughfourmaincomponents : 1. theclassloadersubsystemloads, ??, ? intinitializes.classfilesusingbootsprap, extension, andapplicationclassloaders, ensuringsecureandlazyclasloa

?? ?? ? ?? ???? ???? ?? Java.Time ???? ???? ??????. 2. LocalDate, LocalDateTime ? LocalTime? ?? ?? ??? ??? ?????. 3. () ???? ???? ?? ??? ??? ????. 4. ???/???? ??? ???? ??? ????? ??? ??????. 5. ZonedDateTime ? Zoneid? ???? ???? ??????. 6. DateTimeFormatter? ?? ?? ? ?? ?? ?? ???; 7. ??? ?? ?? ?? ??? ????? ?? ??????. ?? Java? ?? ??? ???? ??? ??? ???? Java.Timeapi ??? ?? ??? ???????.

Pre-FormancetArtUptimeMoryUsage, Quarkusandmicronautleadduetocompile-timeprocessingandgraalvsupport, withquarkusoftenperforminglightbetterine serverless sinarios.2.thyvelopecosyste,

NetworkPortSandfirewallsworkTogetToenableCommunication whileensuringsecurity.1.networkportSarevirtualendpointsnumbered0–65535, Withwell-nownports like80 (http), 443 (https), 22 (ssh) ? 25 (smtp) ?? (specservices

Java 's Garbage Collection (GC)? ???? ???? ???? ??????, ?? ? ??? ??? ? ??? ??? ??? ??? ????. 1.GC? ?? ?? (? : ?? ??, ?? ???, ?? ?? ?)?? ??? ???? ????, ?? ? ??? ??? ???? ?????. 2. ?? ???? ????? ????, ?? ?? ??? ??? ???? ?? ??? ??????. 3. ?? ?? ?? ?? : ??? ?? (Eden, S0, S1)? ?? ????? ?????. ??? ??? ?? ? MajorGC? ???? ? ??? ? ????. Metaspace? ??? ?? ???? ?????. 4. JVM? ??? GC ??? ?????. SerialGC? ??? ?? ????? ?????. ParallelGC? ???? ??????. CMS? ?? ???

GradleisBetTerChoiceFormostNewProjectSduetoitssuperiorflexible, Performance, and ModernToolingsupport.1.Gradle'Sgroovy/kotlindslismoreConcisENDEXPRESSIVETHANMAVEN'SVOSEXML.2.GradleOutsMaveninbuildweedweedweedweedweedweedweedweedweedweedweedweedweedweede

DEFER? ??? ???? ?? ??? ??? ???? ? ?????. ?? ??? ?? ? ? ?? ????, ??? ??? ? ?? ?? (LIFO)? ??? ?????. 1. ?? ??? ??? ? ??? ?????. 2. ?? ??? ?? ??? ??? ????? ?????. 3. ?? ? ?? ?? ??? ? ????. 4. ??? ?????? ??? ??? ???? ?????. 5. ?? ??? ???? ?? ??? ?? ??? ?????. ??? ??? ?? ?? ? ???? ???? ? ????.
