Bug 576184 - Doesn't show cannot override show() in A attempting to assign weaker access privileges as it is supposed to and compiles without error
Summary: Doesn't show cannot override show() in A attempting to assign weaker access p...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.21   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-09-22 04:20 EDT by prabhanshu singh sikarwar CLA
Modified: 2023-09-13 17:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description prabhanshu singh sikarwar CLA 2021-09-22 04:20:26 EDT
Doesn't show cannot override show() in A attempting to assign weaker access privileges as it is supposed to and compiles without error


class A{
	 void show() {
		System.out.println("konichwa");
	}
}
class B extends A{
	
	 private void show() {
		System.out.println("konichwa22");
	}
}
/* Name of the class has to be "Main" only if the class is public. */
class test3
{
    public static void main (String[] args) throws java.lang.Exception
    {
     A a1= new B();
     a1.show();
    }
}
Comment 1 Andrey Loskutov CLA 2021-09-22 05:14:19 EDT
I can't reproduce on 4.21 and 4.22 master, I see correct error 
"Cannot reduce the visibility of the inherited method from A".

Please provide steps to reproduce & used Eclipse version, or explain what exactly should be a problem here.
Comment 2 Eclipse Genie CLA 2023-09-13 17:02:55 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.