Navigation Home JAVA SOFTWARE - CORE JAVA - ADVANCE JAVA ENGINEERING - MECHANICAL - - Fluid Mechanics - - - Impact of jets - - - Hydraulic Turbines - - Metallurgy - - - Basic concepts - - - Alloys and Phase Diagrams - - - Heat treatment - - - Ferrous Materials - - - Non ferrous materials and alloys - - - Non-Metallic Materials - - - Mechanical Properties And Testing - - Theory of Machines - - - Basic concepts - - - TORSIONAL VIBRATIONS - - - Automatic Control Systems - - MANUFACTURING PROCESSES - - - CASTRING PROCESS - - - Metal Forming Processes - - - - BASIC METAL FORMING PROCESSES AND USES - - - - Forging - - - - Rolling - - - - Extrusion, Wire Drawing, Tube Drawing and Making - - - - Press Work and Die-Punch Assembly - - - MACHINING PROCESSES AND ITS APPLICATIONS - - - - Lathe - - - - Shaper - - - - Planer or Planning Machine - - - - Drilling Machines - - - - MILLING MACHINE - - - - Grinding Process - - - - Welding Process - CIVIL - ELECTRICAL - ELECTRONIS - COMPUTERS - SOFTWARES - DOT NET - UNIX - JAVA SOFTWARE - SAP SOFTWARE - - SAP MM - - - introduction - - - Role-responsibilities of MM consultant - - - T.Codes - - - Tables - - - Errors-solutions - - - Interview Questions - - SAP FICO - - SAP ABAP - - SAP SD APTITUDE G.K - Full Width - Right Sidebar - Left SIdebar English - Stars - Points - Percent - in The Top Error Page
Can you access non static variable in static context ?
A static variable in Java belongs to its class and its value remains the same for all its instances.
A static variable is initialized when the class is loaded by the JVM.
If your code tries to access a non-static variable, without any instance, the compiler will complain, because those variables are not created yet and they are not associated with any instance.
No comments:
Post a Comment