Why Gigster?
    • Top talentTop talent
    • Managed serviceManaged service
    • Liquid workforceLiquid workforce
    • Scalable infrastructureScalable infrastructure
    • Enterprise securityEnterprise security
      Why Gigster?
      • Top talentTop talent
      • Managed serviceManaged service
      • Liquid workforceLiquid workforce
      • Scalable infrastructureScalable infrastructure
      • Enterprise securityEnterprise security

      Java Interview Questions - Variables

      Here are the most popular Java interview questions about variables.

      See all questions

      What happens if you use a primitive local variable before initializing it?


      The Java compiler will throw an error. Local variables do not get initialized to any default value even if they are primitives like int or boolean. Every local variable needs to be assigned a value before it can be accessed.

      Looking for developers?