Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Controlling access of packages(Change the visibility od packages)
Controlling access of packages [message #1130228] Wed, 09 October 2013 10:37
Pierrick MARIE is currently offline Pierrick MARIEFriend
Messages: 1
Registered: October 2013
Junior Member

With the Eclipse Java editor it is possible to change the visibility of declared packages like this :

private package com.mypackage

class Foo {
 // say hello

With Eclipse, this piece of code is executed normally with no problem. Whatever the keyword before the package declaration (private, protected or public) the compilation and the execution produce the same result.

But, as it is specified by Java, it is impossible to change the visibility of packages, see :
If I compile manually this code I have an error :

$ javac com.mypackage.Foo error: class, interface, or enum expected
private package com.monsuperpackage;
1 error

I don't understand why it is possible to change the visibility of packages with the Eclipse Java editor (and only with it). What is the feature ?

ps : I use the version 1.7.0_25 of javac.

Thank you.
Previous Topic:Debugger Not Working
Next Topic:Is the Workbench guaranteed to be available when a plugin with dependency on org.eclipse.ui starts?
Goto Forum:

Current Time: Sun May 27 23:49:34 GMT 2018

Powered by FUDForum. Page generated in 0.01972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top