Questions tagged [class-visibility]

In certain object-oriented programming languages, such as Java, class visibility determines the level of visibility or of accessibility of a class. For methods' or attributes' visibility, or for a more general tag on access modifiers, you might want to use the tag [access-modifiers].

In certain object-oriented programming languages, such as Java, class visibility determines the level of visibility or of accessibility of a class.

Generally the access modifiers used are: public, private or protected.

A question connected with the visibility of a class in an object-oriented programming language should use this tag.

For methods or attributes visibility, or for a more general tag on access modifiers, you might want to use the tag .

99 questions
0
votes
2 answers

How to access non-static class fields in a package from the (default package)?

So I have this class (let's call it "A") with this get() method which returns a class field, and which I want to access from another class ("B"). Important: both classes are abstract. These classes are in the same package (package private for all A…
0
votes
3 answers

Converting class properties to struct respecting visibility

I'm working on a simulink model that is configured on different modes that change the model parameters based on the stuff like the chosen sample rate filter group delay, etc... I though of setting all the parameters on a ParameterStruct, then load…
xvan
  • 4,554
  • 1
  • 22
  • 37
0
votes
1 answer

PHP - How to extend and access parent constructor properties

I am attempting to access the parent class __construct properties within a child class that extends this, however not sure how to do this as I have tried multiple methods and didn't give me the expected result. So I have a baseController and a…
mhvvzmak1
  • 307
  • 2
  • 12
0
votes
1 answer

show an element based on what in a edittext in android

I am a newcomer in android. Please forgive me if i am asking anything stupid. I want to show/hide an element (TextView) based on the user input in an EditText element. Basically there are 3 textview . Based on what is being entered in the edittext,…
0
votes
1 answer

Which is the better way to visually hide things, clip: rect(0, 0, 0, 0) or visibility: hidden?

Recently, I saw some tricks on hiding things. What I'm curious about is what's the difference between clip: rect(0, 0, 0, 0); and visibility: hidden;, while both can hide things and remain the space in the same time. Also, is there any difference…
chenghuayang
  • 1,424
  • 1
  • 17
  • 35
0
votes
0 answers

PHP Property Visibility: Allow Certain Files Access

I know this is a bit strange but I'm toying with a concept and I'm not sure the best method to execute it. In PHP, you have the ability to make methods and properties public or private. Within our project, I want to force our php controllers to…
Sabrina Leggett
  • 9,079
  • 7
  • 47
  • 50
0
votes
1 answer

Can't pass protected enum as parameter for static method

I've been updating the company's software and stumbled upon this problem. There's this enum that's protected and I want to pass a value from that enum as a parameter for a static method, but I can't cause I have no access to it even though both the…
0
votes
1 answer

javac gives no warning when a class with default access contains public members

Regarding the example code below, although the Test() constructor inside the class Test is public, the class Test itself isn't public, and so the Test() constructor can't be called from outside its own package. Does that make the public keyword…
user2911290
  • 1,396
  • 1
  • 16
  • 26
0
votes
2 answers

Eclipse - I want to access a class from the same package but under a different project, how?

I use Eclipse IDE for my Java projects and all my projects(Project_1,Project_2 and so on) related classes are inside a package package_name. I am currently working on 2…
Keir Simmons
  • 1,634
  • 7
  • 21
  • 37
0
votes
1 answer

CodeContracts static checking says the members of an internal class of another assembly are not visible enough, despite using InternalVisibleTo

I'm writing a program in Visual Studio 2012, and I have a pair of classes in two separate projects: ProjectA: namespace Test { internal class A { private A(B b) { Contract.Requires(b.X != null); } } } ProjectB: namespace…
Philip C
  • 1,819
  • 28
  • 50
0
votes
1 answer

How to access controller from other controller in Laravel?

Maybe I'm doing this wrong alltogether. But I'm doing my first MVC in Laravel. Here is my setup. The app is gonna download data from varoius sources and save to a database for output. I have two controllers. One that saves data to the database and…
Himmators
  • 14,278
  • 36
  • 132
  • 223
0
votes
1 answer

reflection - Accessibility of public static classes nested inside package local classes

In my example I have two packages: package1 contains class A (NOT declared as public) and its nested static class B (declared as public): package package1; class A { public static class B { public B() { } } public A()…
maurizeio
  • 266
  • 2
  • 11
0
votes
2 answers

Get length of array property in internal class in C#, or other iteration method that works?

I have a set of C# classes generated by the json2charp web utility from a JSON response resulting from a REST call. I use the classes to deserialize future JSON responses into those classes. Everything works great. One of the internal classes has…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
0
votes
1 answer

How to render an action from another action in Symfony 1

I am stuck with a Symfony application using version 1.0.17 which can't be upgraded at the moment. Right now there is a page that contains an iframe which loads a webpage of a different action from the same module. The iframe is causing some design…
drew010
  • 68,777
  • 11
  • 134
  • 162
0
votes
3 answers

Invoking public method on a class in a different package via reflection

I ran into the following problem. I have two different packages in package a I would like to call the implemented method of an interface in a package b but the implementing class has package visibility. So a simplifed code looks like this: package…
KARASZI István
  • 30,900
  • 8
  • 101
  • 128