GYAN RANJAN NAYAK’s Post

🌱 My Spring Journey : Understanding Spring Contexts & the .class Property in Java Difference between FileSystemXmlApplicationContext and ClassPathXmlApplicationContext : 🔹 FileSystemXmlApplicationContext → Creates the IOC container by locating the Spring bean configuration file from the specified path of the file system. → We can provide either a relative path or an absolute path. 🔹 ClassPathXmlApplicationContext : → Creates the IOC container by locating the given Spring bean configuration file from directories or JAR files added to the classpath. class property / .class property : 🔹 It is useful to get the object of java.lang.Class having the metadata of a given class or interface. Example : Class c1 = System.class; 🔹 Here, class is the static property of type java.lang.Class in the System class. 🔹 c1 is not an object of the System class, but an object of java.lang.Class that holds detailed metadata about the System class. Java Compiler adds multiple things to every class during compilation. Some of them are : 🔹 Adds java.lang.Object as the super class if the class doesn’t explicitly extend any class. 🔹 Adds a non-parameterized constructor if no constructor is defined. 🔹 Adds a static class property of type java.lang.Class, and more. #Java #SpringFramework #CoreJava #IOC #DependencyInjection #JavaDeveloper #BackendDevelopment #LearningJourney

To view or add a comment, sign in

Explore content categories