|
In much of the code I have seen (on SO, thecodeproject.com and I tend to do this in my own code), I have seen public properties being created for every single private field that a class contains, even if they are the most basic type of get; set; like:...
Started by Callum Rogers on
, 13 posts
by 13 people.
Answer Snippets (Read the full thread at stackoverflow):
However public, private answers, nobody has ....
This:
private int age; public int Age { get { return age; } set { age = value; } }
This makes with it, but it is there, and if you need to get fancy you just spell it out later.
|
|
I have a follow up question to Given a private key, is it possible to derive it’s public key?
Are the public and the private keys the 'same' (in the sense that you just choose to make one public) or can you do more with the private key than with the public...
Started by chris on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
An important element to the public key system....
Jane then uses her private key to decrypt it.
That uses two keys -- a public key known to everyone and a private or secret key known only to the recipient to encrypt the message.
|
|
Hello all,
I have private pdb file and I have to convert it to a public one. Is there tool for it?
Thank you in advance.
Started by msh on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If you.
Huh? .pdb files contain debug information - there's nothing private or public about them.
|
Ask your Facebook Friends
|
Is it wrong to use m_varname as public and the same class with _variable as private
Started by yesraaj on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
You should public....
Why would you obfuscate it with "_"?
As for using the same names for public and private in the same class? Make it private, name it perfectly and give getters and setters public.
That it is perfect.
|
|
I just stumbled over this in some C# code...:
public Foo Foo { get; private set; }
How can I do the same thing in vb?
Started by Kjensen on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
End Set End....
End Get Private Set(ByVal _Foo As SomeType Public Property Foo() As SomeType Get Return _Foo End Get Private Set(ByVal value value As Foo) ...
Of course (smacks forehead)...:
Public Property Foo() As Foo Get ...
|
|
How do I create RSA public\private key pair file in Windows?
Started by NotDan on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at superuser):
I usually do ssh-keygen -t rsa -b 4096
gpg4win is a windows port of gpg. .
John T + or if using something like msys/cygwin you can use openssh's ssh-keygen .
You can use PuTTYgen to make a key pair.
|
|
Which access specifier( public private ) is preferred when dealing with multiple (100) threads? I have heard that private is better.
Is it true?
Started by Woland on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Basically it's a good idea to implement everything private or internal as long as you don't have any strong reason to make it public, in other words to expose stuff even though it's private....
Descendants of the class (overriding).
|
|
Can I call public method from within private one:
var myObject = function() { var p = 'private var'; function private_method1() { // can I call public mehtod "public_method1" from this(private_method1) one and if yes HOW? } return { public_method1: function...
Started by krul on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Do something like:
var myObject = function() { var p = 'private var'; function private_method1() { public.public_method1() } var public = { public_method1: function() { alert('do stuff') }, public_method2: function() { private_method1() ....
|
|
All my college years I have been using public, and would like to know the difference between public, private, and protected? Also what does static do as opposed to having nothing?
Answer Snippets (Read the full thread at stackoverflow):
private - can only be accessed methods as ....
= ""; }
is effectively the same as:
public class MyClass { private string s = ""; }
The linked MSDN:
MyStaticClass.ServiceMethod(...);
public - can be access by anyone anywhere.
|
|
What are the benefits of only using public properties instead of using the public property to access a private variable?
For example
public int iMyInt { get; set; }
instead of
private int myint; public int iMyInt { get { return myint; } set { myint = ...
Started by MasterMax1313 on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
So:....
The disadvantage is that you no longer have access to the private backing variable, and sometimes you need that.
Many properties are simple wrappers around private.
To have only public properties and not public fields.
|