Submitted by admin on Wed, 06/08/2016 - 19:46
Given a binary tree, find out if it is a binary search tree or not.
Submitted by admin on Sat, 05/28/2016 - 18:26
This page contains a set of basic exercises that you need to complete along with your beginning Java notes. Exercises are divided into modules similar to the modules for multiple choice questions. Practice these alongside reading notes and answering the multiple choice questions.
Write a HelloWorld program. Write a simple program with a main method that prints Hello World.
Submitted by admin on Mon, 05/23/2016 - 20:32
Factory design patterns help you create objects without using the new keyword directly within your code. The factory intern will create object for you. You can read more about factory pattern @ Factory Design Patterns.
Submitted by admin on Mon, 05/23/2016 - 19:56
This is a quick summary of important annotations in Spring for doing core tasks in Spring. Some of them might have already been covered in examples. Some of them might be covered later. Some of them might be a variation of the already covered ones, so please feel free to try them out and let us know if you face any issues.
You can use @Configuration to specify a Java configuration file.
Submitted by admin on Sun, 05/22/2016 - 22:37
If you invoke getBean("writer") and there are two beans defined with the name writer in your xml configuration file or Java configuration file. What will happen?
It will return the second one defined.
Submitted by admin on Sun, 05/22/2016 - 20:34
Creating a simple maven project using eclipse is very simple. Just a few clicks and you are done creating your first simple maven project. We will also quickly see some observations on the folders and files created by default after creating our simple project.
First, create a new Maven project using the eclipse new project wizard. You can either right click on the project explorer or go from the File menu item, to go to create new project wizard.
Submitted by admin on Mon, 05/16/2016 - 22:30
Through the autowiring feature, spring will intelligently guess some of the bean injection without needing to configure explicitly. Spring can do autowiring based on the type of the bean, name of the bean, and constructor of the bean. Default is autowire by type.
Submitted by admin on Sun, 05/15/2016 - 02:04
A Spring Boot standalone application uses the @SpringBootApplication annotation over a class with a main method that will execute the application. The SpringApplication.run method call accepts two parameters — the class that actually contains the annotated @SpringBootApplication annotation and any application arguments. The ApplicationArguments interface allows you to access any application arguments.
Submitted by admin on Sat, 05/14/2016 - 22:00
We can enable profiles from within a JUNIT test using @ActiveProfiles annotation. If you don't specify one, profile will be activated based on property value. This excercise writing JUNIT is applicable for code without profiles also: you just have to not activate any profiles.
Submitted by admin on Sat, 05/14/2016 - 21:14
We can use the property 'spring.profiles.active' within a properties file to activate a profile and is the most preferred approach.
In last note, we had seen enabling Spring profiles from the main method itself by calling getEnvironment().setActiveProfiles method on the AnnotationConfigApplicationContext object.