About 47,500 results
Open links in new tab
  1. Java: define terms initialization, declaration and assignment

    So how do you define them? The Circular Definitions initialization: to initialize a variable. It can be done at the time of declaration. assignment: to assign value to a variable. It can be done …

  2. java - Should I initialize variable within constructor or outside ...

    It also makes sense to consider final variables in such a situation. If you know what value a final variable will have at declaration, it makes sense to initialize it outside the constructors. …

  3. java - When are static variables initialized? - Stack Overflow

    I am wondering when static variables are initialized to their default values. Is it correct that when a class is loaded, static vars are created (allocated), then static initializers and initializa...

  4. Java -- Initializing superclass variables in subclasses?

    Jun 29, 2016 · Java -- Initializing superclass variables in subclasses? Asked 12 years, 11 months ago Modified 9 years, 5 months ago Viewed 36k times

  5. Why must local variables, including primitives, always be initialized ...

    Oct 13, 2009 · Such "old-school" programming languages might be the reason, that the recommendation to always initialize variables pops up in books and discussions about modern …

  6. Initializing multiple variables to the same value in Java

    Jun 1, 2016 · 76 You can declare multiple variables, and initialize multiple variables, but not both at the same time:

  7. Declaring variables inside or outside of a loop - Stack Overflow

    Jan 10, 2012 · Difference between declaring variables before or in loop? According to my understanding this thing would be language dependent. IIRC Java optimises this, so there isn't …

  8. Java: Initialize multiple variables in for loop init?

    6 Variables declared in the initialization block must be of same type we can't initialize the different data types in the for loop as per their design. I'm just putting a small example.

  9. java - Initialize member variables in the beginning of class …

    Jun 16, 2013 · 42 What is the difference between defining and initialising the member variables in the beginning of the class definition, and defining the member variables first and initialising the …

  10. Use of Initializers vs Constructors in Java - Stack Overflow

    Apr 30, 2009 · I assume you are saying both: static initializers can be used to set the value of "final" static variables whereas a constructor cannot instance initializers can be used to set the …