Is it possible to make an object “Read Only” to a method

后端 未结 11 1850
攒了一身酷
攒了一身酷 2020-12-29 06:33

If an object reference is passed to a method, is it possible to make the object \"Read Only\" to the method?

11条回答
  •  囚心锁ツ
    2020-12-29 06:46

    private boolean isExecuteWriteQueue = false;
    public boolean isWriting(){
        final boolean b = isExecuteWriteQueue;
        return b;
    }
    

提交回复
热议问题