Omgili - forum search, search forums  
  

Discussions about public static

Displaying 1 - 10 out of 49,731 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
Hi, If you have a class member that is static and public. Would you write "static public" or "public static"? I know they are the same. But is there some recommendation / best practice for writing this?
Started by on , 5 posts by 5 people.  
"public static....
I personally would go with public static because it's more important that it's public than, but the concept is the same) Short version: "public static" is recommended and is far more common.
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 , private )? Assuming all your methods, static or otherwise...
Started by on , 7 posts by 7 people.  
I guess 'public static' is really the most common format in favor of '....
Thanks for the input, guys.
public static looks correct to me if it's public.
Neither language has this requirement.
Line is completely false.
Consider this sample class, class TargetClass { private static String SENSITIVE_DATA = "sw0rdfish"; private static String getSensitiveData() { return SENSITIVE_DATA; } } When I do this, import java.lang.reflect.Method; public class ClassPiercing { public...
Started by on , 3 posts by 3 people.  
The point....
Http://java.sun.com/javase/6/docs/api/java/lang/SecurityManager.html http://java.sun.com/javase/6/docs/technotes/guides/security/permissions.html#ReflectPermission disabling ReflectPermission should do the trick.
Well, use a SecurityManager.
Ask your Facebook Friends
In Java I can write: public final static MyClass foo = new MyClass("foo"); is there an equivalent in C#?
Started by on , 3 posts by 3 people.  
Think of is readonly : public static readonly MyClass field = new MyClass("foo"); sealed class.
When trying to compile my class I get an error: The constant 'NamespaceName.ClassName.CONST_NAME' cannot be marked static. at the line: public static const string CONST_NAME = "blah"; I could do this all of the time in Java. What am I doing wrong? And...
Started by on , 4 posts by 4 people.  
A const....
From the C# language specification (PDF page 287 - or 300th page of the PDF): Even though constants are considered static members, a constant declaration neither requires nor allows a static modifier.
Const implies static.
Hello, I'm new to C#.Till this moment I used to make every global variable - public static.All my methods are public static so I can access them from other classes. I read on SO that the less public static methods I have,the better.So I rewrote my applications...
Started by on , 7 posts by 7 people.  
Your question seems like a duplicate of: http://stackoverflow.com/questions/99688/private-vs-public int pin = 1090; ....
static on the other hand has no relation to the two, because.
With the user having access to should be public.
So we've all seen the Threading notification on MSDN for many available generic objects: "Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe." My question is, what is ...
Started by on , 5 posts by 5 people.  
It's still possible to have race conditions in static / shared methods if they touch....
Static methods in general do not access shared state and hence are less likely to run into this problem.
Not access shared state in a thread safe manner.
It seems to me that non-public top-level classes and static nested classes essentially perform the same tasks when creating a helper class. A.java public class A { public static main (String[] args) { AHelper helper = new AHelper(); } } class AHelper ...
Started by on , 5 posts by 5 people.  
But generally, you use a static nested other class in the same file as the....
You cannot do this for anyIn neither example do you have one class per source file .
One difference is that a static nested class can be declared public.
I figured out how to create a static method that is available everywhere, for example: UtilLib.as: package { public final class UtilLib { public static function getTimeStamp():uint { var now:Date = new Date(); return now.getTime(); } } } I can access ...
Started by on , 5 posts by 4 people.  
} The syntax might be incorrect; import flash.events....
} you have public static function writeTimeStamp(messageBox):uint { ...
So instead of public static function getTimeStamp():uint { ...
Pass in a pointer to your textbox.
I'm trying to get a real equivalent for Java's public static final in Scala for using TwiP . Creating a val in an object don't works for me, because it's part of a new generated class Example$.class and TwiP can't access it from class Example.class. Here...
Started by on , 4 posts by 3 people.  
You want to use public static final on a variable, as a better solution might be more obvious definition in the companion object creates your public static final variable, and the import declaration gives it a nice easy alias....
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost