Hey Guys, I am creating this blog to share deep knowledge in Java, JSP, Servlets, JDBC, Hibernate, Spring and Spring MVC in details.

Can you access non-static variable in static context?

Can you access non-static variable in static context? Static-variable in Java belongs to Class and its value remains the same for all instances. static variable initialized when class is loaded into JVM on the other hand instance variable has different value for each instance and they get created when the instance...
Share:

What is the immutable object? What is the difference between creating String as new () and literal? What is difference between Strings vs. StringBuffer vs. StringBuilder in Java?

What is the immutable object? What is the difference between creating String as new () and literal? What is difference between Strings vs. StringBuffer vs. StringBuilder in Java? Immutable object: Immutable classes are Java classes whose objects cannot be modified once created. Any modification in Immutable object results in...
Share:

Why Constructors are not inherited in Java?

Why Constructors are not inherited in Java? Constructor is a block of code that allows you to create an object of the class and has the same name as a class with no explicit return type. Whenever a class (child class) extends another class (parent class), the subclass inherits state and behavior in the form of variables and methods from its superclass...
Share:

What is the Singleton Design Pattern and its implementation in Java?

What are the Singleton Design Pattern and its implementation in Java? Singleton is a design pattern which ensures there is only one object of the class is created for the entire application. Step to make the Singleton pattern: 1.     Declare constructor...
Share:

Can we overload the static method and can we override the final method in Java?

Can we overload the static method in Java? Yes, you can overload a static method in Java. You can declare as many static methods of the same name as you wish provided all of them have different method signatures. public class Test {             public static void Show(int...
Share:

Popular Posts