我有一個Java中的「私有靜態」嵌套類。訪問修飾符對此類中的字段和方法有什麼意義?我已經嘗試了公共和私人,對我的應用程序沒有任何影響。 public class MyList<T>{
private static class Node{ // List node
private Object item;
private Node next;
priva
是否有一種語言具有可以阻止類訪問任何其他類的功能,除非包含實例或引用? isolated class Example {
public Integer i;
public void doSomething()
{
i = 5; // This is ok because i belongs to this class
/*
*