>One class one file
Why though
One class one file
Code readability, fgt.
Yeah, I personally prefer 2 files per class.
Welcome to C
I guess you haven't gotten to the part of your tutorial series where they teach you about nested classes?
I am using Head first Java. Is there any concept of Singleton class in Java?
>class
>C
>not realising xe is talking about header files and source files
C# is actually the best language, don't fall for the Jow Forums retard memes.
I use it daily at work, since I do gamedev work. Modern c# combined with Unity's Burst Compiler is actually insanely good.
One public class
>C# is actually the best language
C# is not even better than Java 11 and it's most certainly not better than Kotlin
>C#
>Unity
street shitter tier
Weird Kotlin flex but okay
You can nest as many classes as you want but i wouldnt advise it
>source files and classes are the same thing
you heard it here first
The most common way to instantiate a singleton in Java is:
public class Singleton {
private static final Singleton INSTANCE = new Singleton();
private Singleton() {
// constructor/init code goes here
}
public static Singleton getInstance() {
return INSTANCE;
}
}
Enjoy your race conditions, oniifam.
I live in LA and make $120k/year :^)
Dumb Jow Forums is wrong as usual
>not bootstrapping OO in C using macros and then forking each statement into a separate directory
Enjoying your shack an hour away from the office?
It's 1000 sqft and I live 10 minutes from work. Keep staying mad, retard.
>C# is not even better than Java 11
You either don't know C# or just are delusional.
>Java
Why though
Its comfy
>public static void main()
>comfy
That's low for LA. I make the same in Seattle doing web shit.
I'm sorry but this is just retarded. The fact that you have to force only a single instance of a class ever being instantiated is just... retarded. Also HFDP was written by wymyn who have no idea how to actually write code
yes.
A file is just an abstraction of the class hierarchy, which java revolves around. Keeping your classes separated is just a style of programming.
If you want to see how to NOT handle classes, take a look at the python "self"
HFDP?
>class can be accessed from anywhere
>it cannot be instantiated
>It returns shit
>And it is main
What the fuck is so hard about it?
>C# is actually the best language
judging it purely as a language C# is leagues better than Java
I'm not in the inner city, rent isn't that bad.
The part where you need a noninstantiable class when all you want is a function.
That one webcomic about languages was true. C# is a powerful laser strapped to a donkey. When you remove the donkey, it seems to work worse.
Retard who hasn't used c#
>Object Oriented Programming
>Doesn't want to use objects
I honestly don't even know why you are here.
>we should add a feature just so that main looks prettier
>macros and preprocessor hacks
ew
Was an analogy, retard
Every framework that runs C# performs like shit. .NET core is so fucking slow compared to JvM frameworks like vertx
>instantiating at class load
You're supposed to do that on the first call to getInstance
>OO in C using macros and preprocessor hacks
Look at Glib and other GTK+ libraries