Questions tagged [private]

Private is a way of encapsulation in object-oriented programming.

Private is a way of encapsulation in object-oriented programming.

2890 questions
1
vote
0 answers

How to give permission to remote desktop user to Delete Private Queues

I have been trying various methods to give remote desktop users permission to delete private queue. What i already tried is From Admin account I went to Computer Management > Service and Applications > Private Queues > Then i opened properties of…
1
vote
1 answer

Set a public attribute as private

In class vertex{ // ... }; I'm tryng to set this public attribute as private. vector edges; But here void addedge(int from, int to, int length=-1) { vertices[from].edges.push_back(edge(to, length)); } And here edge &e =…
Fab
  • 71
  • 2
  • 7
1
vote
1 answer

android annotations MyTask_(Context) has private access in MyTask_

I`m using @EBean MyTask class with androidannotations.I want to create new instance of the generated class like this myTask = new MyTask_(this); and it gives me error: Error:(65, 28) error: MyTask_(Context) has private access in MyTask_ Generated…
nAkhmedov
  • 3,522
  • 4
  • 37
  • 72
1
vote
2 answers

Automatically update some "private" attribute whenever some other instance attribute is modified

Please make some code that recomputes object._x whenever object.x is updated. I intend object._x to be a "private" attribute of object and object.x to be a "dummy variable" whose only purpose is to set the value of object._x. class tihst(object): …
EricVonB
  • 238
  • 3
  • 11
1
vote
2 answers

private final int blanki; private final int blankj;

I have this code: public final class Board { private final int[][] blocks; private final int N; private final int blanki; private final int blankj; int i, j; // construct a board from an N-by-N array of blocks public…
1
vote
1 answer

The concept of private

Private is a access specifier. It means that anything say a instance private declared private cannot be accessed by methods of another class. What is the point of being private if it can be changed by public methods. Maybe it is because either…
1
vote
2 answers

Initializing a private static member variable in the cpp file. error: member is private

Here is a simple example illustrating my problem. IDGenerator.hpp #ifndef IDGENERATOR_HPP_ #define IDGENERATOR_HPP_ class IDGenerator { private: static int s_nNextID; // make the IDGenerator class a static class with a private…
mdude380
  • 100
  • 9
1
vote
2 answers

Is there a way to protect a class variable from being modified outside of a function

I have a volume variable that I want to be protected from modification unless the person calls a certain function. Is there a way to make it to where it can only be modified by that function other than creating a private class within the class. I…
Gandalf458
  • 2,139
  • 1
  • 21
  • 36
1
vote
2 answers

why we cannot override private and final methods?

Why we can make a method of same signature as a private method but we can not override it I am no understanding why we cannot override a private method but we can make another method of same signature I think that they are the same.
Sara Chatila
  • 101
  • 1
  • 8
1
vote
2 answers

Stop scrolling to top in UIWebView - iPhone

I have placed following javascript in my html file. I am scrolling my webview by following…
sagarkothari
  • 24,520
  • 50
  • 165
  • 235
1
vote
5 answers

class modifier issues in C# with "private" classes

I had a class that had lots of methods: public class MyClass { public bool checkConditions() { return checkCondition1() && checkCondition2() && checkCondition3(); } ...conditions methods public…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
1
vote
3 answers

c++ class: using a private array in a public function?

Here's the code I'm working with in the header file: #ifndef TETRIS_TETRIMINO #define TETRIS_TETRIMINO const int TETRIMINO_GRID_SIZE = 4; struct Location { int row; int col; }; class Tetrimino { private: int…
Zearia
  • 123
  • 7
1
vote
1 answer

Using private class in Android

Hi I have a question about using private class in Android activities. Let's say I have a simple listView in an activity. I want to define an adapter class for this listView(which extends BaseAdapter). Since the adapter is pretty simple, I want to…
user2062024
  • 3,541
  • 7
  • 33
  • 44
1
vote
3 answers

Accessing a private data member from within a member function

In a file named maze.hpp (a header file) I have the following: class Maze { public: Maze(int size); ~Maze() {} void step(); private: int exitRow; }; In another file named maze.cpp I have the…
Davido Widre
  • 185
  • 2
  • 13
1
vote
2 answers

J2ME private folder(only accessible to my midlet)

I have two midlets, one will download some files form server everyday and the other uses these files. If i download the files to a normal folder the mobile user may delete the folder or files manually. So i need a private folder which is hidden and…
Shankar
  • 11
  • 2