Spring @Configuration, @Bean, @PostConstruct And @PreDestroy Annotations With Examples
Java Concept Of The Day
by pramodbablad
2M ago
@Configuration and @Bean are two important spring core framework annotations using them you can configure a spring application without using any XML file. @PostConstruct and @PreDestroy are method level annotations which specify the methods to be called after a bean is constructed and before a bean is destroyed respectively. Let’s see spring @Configuration, @Bean, @PostConstruct and @PreDestroy annotations in detail with examples. Spring @Configuration And @Bean Annotations : @Configuration and @Bean annotations are used to construct a configuration class which can be used by the spring contai ..read more
Visit website
80+ Pattern Programs In Java
Java Concept Of The Day
by pramodbablad
5M ago
Java programs to print the numbers or stars or any other characters in different patterns are one of the frequently asked interview programs mostly for freshers. Because, they test the candidate’s logical ability as well as coding skills which are ‘must have skills’ for any software engineer. In this post, I have collected some of the different number, star and character pattern programs in Java and have tried to solve them. I hope they will be helpful for you guys. Table Of Contents : Number Pattern Programs In Java : Pattern 1 : Java Program : Pattern 2 : Java Program… The post 80+ Patt ..read more
Visit website
Spring @Primary Annotation With Example
Java Concept Of The Day
by pramodbablad
6M ago
In the previous post, we have seen how @Qualifier annotation is used to specify which bean to use when there are multiple beans of same type are available in the container while auto-wiring. @Primary annotation is also used for same purpose but it specifies the highest preferred bean when there are multiple beans of same type are available in the container while auto-wiring. In this post, we will see spring @Primary annotation with some simple coding examples and how it is different from @Qualifier annotation. Spring @Primary Annotation With Example : @Primary annotation is used to indicate wh ..read more
Visit website
Spring @Qualifier Annotation With Example
Java Concept Of The Day
by pramodbablad
7M ago
In the previous post, we have seen how @Autowired annotation is used to auto-wire the spring components. By default, spring auto-wires the components by type. If there are more than one bean available of the same type, spring faces the ambiguity and throws an exception. To avoid the ambiguity while auto-wiring, @Qualifier is used to tell the spring which bean to use. In this post, we will see how to use spring @Qualifier annotation with an example. Spring @Qualifier Annotation With Example : Spring @Autowired annotation auto-wires the dependencies by type. Spring framework faces the ambiguity ..read more
Visit website
Spring @Autowired Annotation With Example
Java Concept Of The Day
by pramodbablad
7M ago
Spring @Autowired is a dependency injection related annotation used to auto-inject the dependencies of a component. Annotation based dependency injection in spring framework is introduced from Spring 2.5. Let’s see spring @Autowired annotation in detail with an example. Spring @Autowired Annotation With Example : @Autowired annotation is used for automatic injection of dependencies into a component class. This annotation can be used with a field or with setter methods or with a constructor. For example, suppose there are two component classes, ClassABC and ClassXYZ. Assume that ClassXYZ is dep ..read more
Visit website
Spring @Component Annotation With Example
Java Concept Of The Day
by pramodbablad
8M ago
@Component annotation is an important stereotype annotation in spring core framework. Classes declared with @Component annotation are auto-detected by the spring container for dependency injection. Let’s see what is spring @Component annotation and how to use it with an example. Spring @Component Annotation With Example : @Component is a class level annotation which is used to indicate that spring container can auto-detect this class for bean creation. Spring container automatically detects the classes declared with @Component annotation if you are using annotation based configuration, instant ..read more
Visit website
Spring Java Code Based Configuration
Java Concept Of The Day
by pramodbablad
8M ago
Spring application can be configured in three ways – through an XML file, through annotations and through Java code. In an XML based configuration, all configurations are done using an XML file. In annotation based configuration, all configurations are done using annotations but your configurations to work, you have to enable them in an XML configuration file. But in Java code based configuration, we never use any XML file. Configurations are done purely using annotations and Java code. Let’s see how to configure a spring application using Java code. Spring Java Code Based Configuration : Your ..read more
Visit website
Spring Annotation Based Configuration
Java Concept Of The Day
by pramodbablad
8M ago
Spring IoC container uses POJO classes and configuration metadata to set up the application ready for use. This configuration metadata can be supplied in three ways – XML based configuration, Annotation based configuration and Java based configuration. We have already seen how to configure a spring application using XML file. In this post, we will see how to configure a spring application using annotations. Let’s start spring annotation based configuration. Spring Annotation Based Configuration : To configure your spring application using annotations, you first have to include context namespac ..read more
Visit website
Python Data Types
Java Concept Of The Day
by pramodbablad
9M ago
Data and data type form the core of any programming language. Be it C, C++, Java, Python or any other programming language, special attention has been given to what type of data they can handle. Python gives you many options and flexibility to choose between different available data types. Let’s see Python data types in detail. Python Data Types : Below is the quick reference sheet for Python data types. Save it for future reference. Numeric Types : int, float and complex are three data types in Python which handle numbers. int : int represents a whole number. It can… The post Python Data Type ..read more
Visit website
Spring IoC Container
Java Concept Of The Day
by pramodbablad
9M ago
Dependency Injection (DI) is a design pattern where dependencies of an object are injected externally through constructors or through setter methods and hence achieving loose coupling in the code. Dependency Injection is also called as Inversion Of Control (IoC) as the control is inversed in this pattern as the control has been given to external sources to create and manage the dependencies instead of objects themselves. Spring IoC Container is responsible for implementing Dependency Injection or Inversion of Control pattern in the spring framework. Let’s see Spring IoC container in detail. Sp ..read more
Visit website

Follow Java Concept Of The Day on FeedSpot

Continue with Google
Continue with Apple
OR