Hello everyone I am a beginner and this is my first post on this forum and also english is not my first language but I hope it is good enough to make you guys understand my question.
The question is why I get error when initializing a variable like this in a class ?
public class MyClass { int a; a=5; // error }
I don't get error when doing it like this.
public class MyClass { int a = 5; }