private Questions
4
Solved
I want to call a private functions of class SomeClass from outside of this class:
class SomeClass {
private fun somePrivateFunction() {
//...
}
private fun somePrivateFunctionWithParams(text: ...
Gaucherie asked 17/12, 2019 at 9:12
4
Solved
I want to make class A friend of class B. I want to do this as these interact very much and A needs to change internals of class B (which I don't want to expose using public). But I want to make su...
Equinox asked 22/10, 2009 at 19:34
2
Solved
I have a code-base which consists of Swift top-layer which is meant to be public API and Objective-C "guts" and I need to wrap it up nicely into the iOS .framework so other developers can incorpora...
Fawnfawna asked 29/1, 2020 at 19:24
4
I would like to keep both public and private issues in my team's github repo.
I'd rather prefer that some issues are not open to other people than just my teamates.
Slavophile asked 16/6, 2020 at 6:29
6
Solved
class Employee{
// salary variable is a private static variable
private static double salary;
// DEPARTMENT is a constant
public static final String DEPARTMENT = "Development";
public static vo...
16
Solved
I have a class with a private static final field that, unfortunately, I need to change it at run-time.
Using reflection I get this error: java.lang.IllegalAccessException: Can not set static final...
Liberec asked 21/7, 2010 at 16:35
2
Solved
Private inner module returning private item gives "private type in public interface" error
In the below example, the module outer has a private type Private and a private inner module inner. inner is able to access Private (because child modules can access their parent's private items, e...
14
How do I create a private constructor which should be called only by the static function of the class and not from else where?
Disheveled asked 21/11, 2011 at 12:48
16
Solved
I'm coming from the Java world and reading Bruce Eckels' Python 3 Patterns, Recipes and Idioms.
While reading about classes, it goes on to say that in Python there is no need to declare instance ...
32
Solved
In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheri...
Uro asked 18/10, 2008 at 19:53
2
I want developers to use a class / interface instead of importing functions directly.
Is there a way to limit so only the class can import the function?
I don't want to have to put all the function...
Hyo asked 4/1, 2021 at 5:3
9
Solved
I have a question about private constructors in C++. If the constructor is private, how can I create an instance of the class?
Should we have a getInstance() method inside the class?
Fissile asked 4/7, 2011 at 7:25
5
Solved
By making private constructor, we can avoid instantiating class from anywhere outside. and by making class final, no other class can extend it. Why is it necessary for Util class to have private co...
Shenika asked 3/9, 2015 at 12:4
3
Solved
I always thought that aggregate initialization was to save coders from writing custom constructors. However, this seems to have "sneaked in" a "security by-pass" for private con...
Trant asked 5/1, 2021 at 14:23
2
Solved
This compiles:
class Node{
int m = 0;
static unsigned f(){
return 1;
}
public:
static unsigned a;
static unsigned b;
};
unsigned Node::a = sizeof(m); // <= !!!
unsigned Node::b = f(); /...
Expertism asked 24/8, 2023 at 8:23
8
Solved
package com.valami;
public class Ferrari
{
private int v = 0;
private void alam()
{
System.out.println("alam");
}
public Ferrari()
{
System.out.println(v);
}
public static void m...
Hyps asked 16/1, 2011 at 19:21
7
Solved
I have to display some private Youtube videos in my blog. I cannot embed them directly. What should I use to do this.
6
Solved
I'm trying out the new class private member feature 🎉 However, I've quickly run into a problem: How does one dynamically access them?
I expected it to follow pre-existing syntax of either
constr...
Marvelous asked 13/4, 2020 at 21:44
2
In a situation when some struct D inherits another struct A twice: once privately via B and the second time publicly via C, is it allowed to write using B::A in D?
struct A {};
class B : A {};
stru...
Guanase asked 24/9, 2021 at 7:24
1
Solved
Before, I would use the old convention of naming fields intended to be private with an _ suffix or prefix.
class X{
constructor() {
this.privateField_;
}
privateMethod_() {}
}
Now that real ...
Roeser asked 25/1, 2022 at 17:20
4
Solved
Is it possible to make a C# base class accessible only within the library assembly it's compiled into, while making other subclasses that inherit from it public?
For example:
using System.IO;
cl...
Gallbladder asked 1/6, 2012 at 22:31
11
Solved
I am using Mocha in order to unit test an application written for Node.js.
I wonder if it's possible to unit test functions that have not been exported in a module.
Example:
I have a lot of functio...
Hatten asked 28/2, 2014 at 14:17
23
Solved
I want to have a class with a private static data member:
class C {
// read-only, can also be static const
// should be filled with all characters from 'a' to 'z'
static std::vector<cha...
Noway asked 28/7, 2009 at 22:26
1
Solved
Why does TSC not compile even with "target:ESnext" private class properties in #property?
Or maybe it will be done in the future?
The es2023 configuration gives an error, for ES2022 it is...
Constance asked 17/2, 2023 at 4:22
15
Solved
I'm wondering if this is the best way to match a string that starts with a private IP address (Perl-style Regex):
(^127\.0\.0\.1)|(^192\.168)|(^10\.)|(^172\.1[6-9])|(^172\.2[0-9])|(^172\.3[0-1])
...
Flexure asked 11/5, 2010 at 19:55
1 Next >
© 2022 - 2024 — McMap. All rights reserved.