Top "Static-classes" questions

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

Why does Android prefer static classes

I see a lot of java code where android prefers to have developers use static inner classes. Particularly for patterns …

java android performance static-classes
C# Static class vs struct for predefined strings

A co-worker just created the following construction in C# (the example code is simplified). His goal was to shorten the …

c# string struct static-classes
How can I run a static initializer method in C# before the Main() method?

Given a static class with an initializer method: public static class Foo { // Class members... internal static init() { // Do some initialization... } } …

c# .net static-methods static-classes static-initialization
Refactoring a static class to use with dependency injection

We need to use an unmanaged library in our code that has static methods. I'd like to introduce the library …

c# dependency-injection refactoring singleton static-classes
Exception in static constructor

I've dug around SO for an answer to this, and the best one I can find so far is here, …

c# exception constructor static-classes
ASP.NET Core Web API Logging from a Static Class

I'm logging just fine using dependency injection on my controllers, now I need to log something from a static class. …

logging asp.net-core dependency-injection asp.net-core-webapi static-classes
Should you avoid static classes?

Are static classes considered bad practice? I read an article about this a couple days ago (can't find it, sorry) …

static-classes
Error: Extension methods must be defined in a top level static class (CS1109)

I'm trying to make a countdown program, which I can start and stop and set the value of the countdown …

c# .net extension-methods static-classes
Laravel : Calling functions defined in base_controller from view

In using the laravel framework, how can I call a function defined in base_controller, in a view. For exacmple: …

php laravel static-classes
Why Abstract class can not be sealed or static?

Why Abstract class can not be sealed or static ? and I am also confuse about this question Why declare static …

c# abstract-class static-classes sealed