Questions tagged [static-class]

In object oriented programming a static class is a class whose members must be accessed without an instance of the class. Its members must be created as static.

In object oriented programming a static class is a class whose members must be accessed without an instance of the class. Its members must be created as static.

90 questions
2
votes
1 answer

Two-way binding to static property in static class

Is that seriously NOT possible? I have solutions to bind one-way to properties in static classes and certainly i have solutions to bind two-way to static properties in non-static classes... but... I mean, the workaround is easy, i can just make my…
Martin Booka Weser
  • 3,192
  • 5
  • 28
  • 41
2
votes
4 answers

C# Static class with Enum

I have a tricky question that has been befuddling me for a while. I have the following code declaration... namespace ESEGURCI.WEB.BusinessLogicLayer.Commons { public static class ParameterUtilities { public enum ParameterEnum …
bastos.sergio
  • 6,684
  • 4
  • 26
  • 36
1
vote
1 answer

How to create Property of Static Class in C# 4.0

I have created following class Static class CustomerServiceData.cs namespace QSys.Library.Security { public static class CustomerServiceData { public static bool CompanyNameUpdatable { get; set; …
imdadhusen
  • 2,493
  • 7
  • 40
  • 75
1
vote
1 answer

How to efficiently get the values from a HashMap with a static class?

I have a class with a HashMap. The type of the values of this HashMap is a static class which has two different objects as attributes. i.e., public class Example { private HashMap map; private static…
LiLou1
  • 31
  • 1
  • 5
1
vote
1 answer

Dependency injection into a static class

Possible Duplicate: Configure Property of a static class via spring .net I want to inject the value for a property inside the static class using spring .net. Code snippet: Public static Abc { Public static IInterface IInterface{get;set;} } here…
Reeta
  • 33
  • 2
  • 5
1
vote
3 answers

Java static error

I'm trying to compile this program in Netbeans: Lab1.java And I get this error... BF.java:27: non-static variable this cannot be referenced from a static context return new Program(new BF().doParse(str)); I've tried everything!
TheFrack
  • 2,823
  • 7
  • 28
  • 47
1
vote
1 answer

How to mock a static method call on an object in a static method?

I 'm a newie in Junit-testing but I have to test some code. I think now I know the basics of it, but I still got a problem on which I couldn't find anything on the Internet: Here's the class I want to test: public static void methodToTest(Label l2,…
1
vote
1 answer

How to get data from static fragment class?

I have an edittext in a fragment in a static class which extends DialogFragment. I need get user input from edittext inside the fragment. I tried instantiating container activity and passing the value but it doesn't work because I need to make it…
Murat K.
  • 35
  • 6
1
vote
1 answer

AS3 Trouble accessing a static class from inside a nested symbol

So basically this is a question about why my calling class (Door) can not identify this static variable class (Game State). it is throwing a #1009 error saying I can not access with GameState.gameState. On my stage I have a Symbol…
KingWrex
  • 13
  • 3
1
vote
1 answer

is there separate static class for each user in web Appllication in asp.net?

I use static class and static attribute and static function in my web Application project for transfer data between web forms but i want that the static class for each user created separate . is there such????? my point is that when a user log in,…
mirza
  • 766
  • 2
  • 7
  • 12
1
vote
2 answers

asp.net: Will the static constructor be called every time there is a postback to a page?

This could be a possible duplicate of Asp.net Static Variable Life time Across Refresh and PostBack but my query is a little different. I have a web application with a page namely default.aspx. I have a public static class "MyClass" with a static…
samar
  • 5,021
  • 9
  • 47
  • 71
1
vote
0 answers

This Handler class should be static or are there leaks?? Whats' happening?

I am newbie android programmer and I found out handle issue with this program, when i try to run the below program it is forcefully closed. Why is this happening ?? How to solve this problem ?? Thank you public class Antivirus extends Activity { …
0
votes
2 answers

Static classes C# constructor OOP

I am new to OOP and I think I don't understand static classes. I want to create a static class Actions and one static method for changing textblock apperance.. Here is my code: public static class Tools { public enum StatusOption { …
blast3r
  • 69
  • 1
  • 4
  • 8
0
votes
2 answers

How to create class with every Property as Static?

i have created Solution which contain 3 Projects like. //Project Name: ClientProject public class UserDetails { public static int ID { get; set; } public static string Name { get; set; } public static string Email {…
imdadhusen
  • 2,493
  • 7
  • 40
  • 75
0
votes
1 answer

How does addObserver:forKeyPath: work on a static class?

I'm trying to build a static class called Logger that will upload the log files at some point, when called like [Logger uploadLogFiles]. I'm trying to add an observer to this static class like so: [Logger addObserver:self…
Alex
  • 7,432
  • 20
  • 75
  • 118