InsideJava

Wednesday, 19 December 2018

Why static code cant have instance reference

Because static code are loaded in when class gets loaded via classloader and at that time, no instance of that class would have got created...
hence compiler finds the issue and complains.

Posted by Sandeep Jaisawal at 11:15
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

All pages

  • Home
  • Apache Kafka
  • JBoss issue

Labels

  • classpath (1)

Featured post

ant build: failed saying "can't find symbol" for few classes

About Me

Sandeep Jaisawal
Java developer
View my complete profile

Blog Archive

  • ►  22 (1)
    • ►  July (1)
  • ►  19 (6)
    • ►  August (1)
    • ►  May (2)
    • ►  April (3)
  • ▼  18 (27)
    • ▼  December (18)
      • Shallow Vs Deep copy
      • Transient variable
      • S.O.L.I.D | SOLID Design principle
      • OOPS basics
      • Saving Singleton
      • Serialization inside
      • Why static code cant have instance reference
      • Immutability
      • Static Vs Dynamic Binding
      • Recursion vs Iterative
      • JSON parsing sample
      • Daemon threads
      • Quick summary : Dead lock and race condition
      • Why String is Immutable
      • Open for extension and closed for modification
      • JVM explained
      • REST API and http/https
      • Process vs Threads
    • ►  November (2)
    • ►  September (1)
    • ►  August (5)
    • ►  June (1)
  • ►  16 (2)
    • ►  December (1)
    • ►  November (1)
  • ►  15 (8)
    • ►  September (3)
    • ►  May (5)

Search This Blog

Simple theme. Powered by Blogger.