public-method Questions

9

Solved

Does it make a difference to mark methods as public in package-private classes? class SomePackagePrivateClass { void foo(); // package private method public void bar(); // public method } Is ...
Paulettapaulette asked 10/3, 2011 at 13:49

10

The new intellij upgrade (10.5) now shows a warning that some of the methods defined for a class are not being used. These methods are public and I plan on not using all of them as I have created t...
Brest asked 29/5, 2011 at 6:50

4

I have *.dll written with C# and I need to get list of all public methods or classes contained in that *.dll. Is there some way to do it programmatically with C#?
Prader asked 17/9, 2011 at 13:0

12

Solved

Should methods in a Java interface be declared with or without the public access modifier? Technically it doesn't matter, of course. A class method that implements an interface is always public. B...
Edentate asked 2/10, 2008 at 10:13

5

Solved

I have a simple question: class my { }; my ob; Compiler allows me to create an object which makes sense. And, I am aware that you can't create object where the constructor is private. To me it...
Yurikoyursa asked 6/8, 2013 at 13:8

0

Given a public API which triggers OTP verification to users, is there a way to prevent such an API from abuse/spam? This API is public and have business reasons so offering on public side. API is ...
Harold asked 3/12, 2017 at 21:4

7

I'm learning Ruby, and have come up to a point where I am confused. The book I am using is talking about private, public, and protected methods, but I am still a bit confused. What are the differe...
Monophonic asked 27/3, 2012 at 2:54

11

Solved

Why can't we use assertion for public methods? I have read somewhere "An assert is inappropriate in public methods because the method guarantees that it will always enforce the argument che...
Laux asked 23/3, 2011 at 11:49

5

Solved

When I implement an interface method, I am forced to make it a public method. We may have cases where we want to use either the default (like in case of access within the same package) or pr...
Search asked 8/3, 2012 at 8:26

7

Solved

I was examining the StringTokenizer.java class and there were a few questions that came to mind. I noticed that the public methods which are to be used by other classes invoked some private metho...

1

Solved

In case I have two methods - one public, one protected that return the reference to same member, I get following compilation error: 'Server::getManager': cannot access protected member declared in...
Induct asked 8/5, 2016 at 19:2

2

Solved

I have a Public Class "General" in which is a Public Sub "updateDynamics". When I attempt to reference it in the code-behind for a page like so: updateDynamics(get_prospect.dynamicsID) I get the...
Liesa asked 19/11, 2012 at 21:22

1

I'm part of a small study group at work that's trying to get a better grasp on what makes JavaScript tick. In our recent discussions about objects, we've learned that an object's public metho...
Dyslogistic asked 8/10, 2015 at 12:16

7

A minor point about function declaration keywords in PHP: If you've got a class method that's static, should the static keyword come before or after the visibility keyword (public, protected, priva...
Quota asked 16/4, 2009 at 18:24

2

Solved

class C { public: void foo() const {} private: void foo() {} }; int main() { C c; c.foo(); } MSVC 2013 doesn't like this: > error C2248: 'C::foo' : cannot access private member declared in...

2

Solved

Given any object I can call #public_methods and see all the methods it will respond to. However, I find it would sometimes be handy to get a quick list of all the public methods that are not inheri...
Foreman asked 13/1, 2012 at 3:59

4

Solved

I try to access a public method from another class. I already tried many examples I found in the web, but they didn't work in the way I wanted them to. Class1.h @interface anything : NSObject { ...
Edris asked 21/12, 2012 at 12:42

2

Up-front: I am aware that R is a functional language, so please don't bite ;-) I've had great experiences with using an OOP approach for a lot of my programs. Now, I'm wondering if there's a way t...
Defunct asked 17/6, 2012 at 17:13

7

Solved

internal class Foo { public void Fee() { Debug.WriteLine("Fee"); } internal void Fi() { Debug.WriteLine("Fi"); } } I'm thinking that Fee() and Fi() are equally accessible since the entir...
Bekah asked 2/4, 2009 at 19:59

2

Solved

I am trying to add an option to a profile page for twitter widget and I have a field where users can add their twitter accounts and below it shows a preview of the widget. It works fine if I enter ...
Warrantee asked 11/2, 2011 at 14:28

1

Solved

I use magical methods in my PHP classes but when i try to put them private, I'm warned : WARN: The magic method __get() must have public visibility and cannot be static in ... I wouldn't lik...
Yearn asked 22/11, 2011 at 17:32

4

Solved

Here is a piece of code: private class myClass { public static void Main() { } } 'or' private class myClass { public void method() { } } I know, first one will not work. And second on...
Help asked 15/10, 2011 at 10:35

6

Solved

If I create a JQuery widget (code example below), and then define a "public" method, is there any other way to call the method other than using the following form? $("#list").list("publicMethod")...
Bagwell asked 5/5, 2010 at 17:20

4

Solved

I noticed that the Smalltalk language has no concept of private/protected methods. All methods are public. Coming from a Java/C++ background, I've thought of this as a fundamental weakness in...
Negligence asked 13/9, 2011 at 9:6

2

Solved

I have an API for interacting with my web app, defined by a class. Each publicly accessible method needs to have authentication done before running. Rather than putting the same line over and over ...
Garlaand asked 13/7, 2011 at 20:47

© 2022 - 2024 — McMap. All rights reserved.