Does adding “synchronized” affect method overriding? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Does adding “synchronized” affect method overriding? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

my problem is that:

search_text.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            ArrayList<Object> GPDMvalue = (ArrayList<Object>) multiSortList.getValue();
            ArrayList<Map<String, Object>> valueList = getDefaultValue(GPDMvalue);
            multiSortList.setDataSource(getGPDMList());//new thread 1
            multiSortList.setDefaultOrAddValue(valueList);//new thread 2

when the text changing too fast ,and the thread 1 or thread 2 does’t excute completely,and the maybe some problem,so i want add the synchronized like this public synchronized void modifyText(ModifyEvent e), is this still a override method and will it work?


Adding the synchronized keyword does not get in the way of overriding a method (it is still overridden) because the method’s signature remains the same.

For more details see JLS-§

We are here to answer your question about Does adding “synchronized” affect method overriding? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji