Hey guys in this post, we will discuss @ControllerAdvice annotation with an example. Overview @ControllerAdvice used for global error handling in the Spring MVC application. It also has full control over the body of the response...
Author - Bushan Sirgur
Hey guys in this post, we will discuss @ExceptionHandler annotation with an example Overview @ExceptionHandler works at the Controller levelĀ and it is only active for thatĀ particular Controller, not globally for the entire...
Hey guys in this post, we will discuss different ways of implementing Threads in Java. Introduction Threads allow a program to operate more efficiently by doing multiple things at the same time. Threads can be used to perform...
Hey guys in this post, we will discuss Access Modifiers in Java and their examples. Overview Access Modifiers in java allow us to set the scope or accessibility or visibility of a data member be it field, constructor, class, or...
Hey guys in this post, we will discuss converting JSON string into a javascript object Convert Javascript object into a JSON String check here By using JSON.parse() method We can use JSON.parse() method to convert JSON string...
Hey guys in this post we will discuss converting javascript object into a JSON string. Convert JSON String into a javascript object check here Using JSON.stringify() method We can use JSON.strigify() method to convert a...
Hey guys in this post, we will write JUnit test cases for Spring boot REST API. We will write test cases for database operations like Create, Read, Update and Delete. Watch the video Development process Following are the...
Hey guys in this post we will discuss everything you need to know about Spring boot @Bean annotation with example. Overview @Bean is used to explicitly declare a single bean, rather than letting Spring do it automatically. It...
Hey guys in this post, we will discuss @Autowire annotation in spring with an example Overview @Autowire annotation can be applied to a constructor, field, or setter method. It helps to autowire the bean without creating an...
Hey guys in this post, we will discuss the most commonly used array methods and their usage. What is an Array? An array is a special variable, which can hold more than one value at a time. There are many useful built-in...
Hey guys in this post, we will discuss spring boot @RequestMapping annotation with an example Overview @RequestMapping is the most common and widely used annotation in Spring MVC. It is used to map web requests onto specific...
Hey guys in this post, we will learn about creating REST API with Spring Boot, PostgreSQL, JPA, and Hibernate. We will also perform the basic CRUD (Create, Read, Update, Delete) operations. Spring framework is one of the most...
Hey guys in this post, we will discuss spring boot @ResponseBody annotation and their example. Overview @ResponseBody annotation can be put on a method and indicates that the method return type should bind to the HTTP response...
Hey guys in this post, we will discuss spring boot @RequestBody annotation and its usage. Overview @RequestBody annotation is used to indicating a method parameter should be bind to the body of the HTTP request. Internally, this...
Hey guys in this post we will discuss basic HTML tags and their usage in web development/web design. Basic Tags Tags Description <html></html> It is the main tag, it creates an HTML...
Hey guys in this post we will discuss Spring boot @RequestParam annotation and its example Read Spring boot @PathVariable annotation Overview The @RequestParam annotation binds the web request parameter to a controller method...
Hey guys in this post we will discuss about the Spring boot @PathVariable annotation and their example in detail. Overview Spring boot @PathVariable annotation used on a method argument to bind it to the value of a URI template...
Hey guys in this post, we will discuss how to place the JFrame window at the center of the screen. Read: Create Basic JFrame window and display it on the Screen When we create the JFrame window, by default it is not centered. It...
Hey guys in this post, we will discuss how to display the basic window using Java Swing. Example import javax.swing.JFrame; public class BasicWindow extends JFrame{ public static void main(String[] args) { UserInput...
Hey guys, in this post we will discuss the Java 8 Stream API collect() method, we will also look at some of the examples. Overview Java stream collect() method is used to perform mutable fold operations means repackaging...
Hey guys in this, we will discuss accepting the user input in Java with Scanner class. If we are creating a console-based application, it’s essential that takes the user input and produces the correct output. So in this...
Hey guys in this post, we will learn about creating REST API with Spring Boot, H2 Database, JPA, and Hibernate. We will also perform the basic CRUD (Create, Read, Update, Delete) operations. Spring framework is one of the most...
Hey guys in this post we will discuss String and their methods in javascript. The string is the most commonly used datatype in any programming language. It’s always good to know that the usage, methods, and examples of...
Hey guys in this post, we will see the 5 different ways of creating objects in java. Let’s discuss it one by one – 5 Different ways Following are the different ways to create a java object. Using new keyword This...
Hey guys in this post, we will learn about creating REST API with Spring Boot, MySQL, JPA, and Hibernate. We will also perform the basic CRUD (Create, Read, Update, Delete) operations. Spring framework is one of the most popular...
Following are the test cases Test cases Result Status haveThree({12,3,4,3,88,3}) true OK haveThree({22,3,3,3,17,3}) false OK haveThree({3,4,3,6,3,7}) true OK Java solution package test; public class Program20...
Following are the test cases Test cases Result Status sum28({10,20,30,40,50,60,2}) false OK sum28({2,10,7,2,2,2}) true OK sum28({5,6,1,2,2,2}) false OK Java solution package test; public class Program19 { public...
Following are the test cases Test cases Result Status nTwice(Hello,2) Helo OK nTwice(Chocolate,3) Choate OK nTwice(java,1) ja OK Java solution package test; public class Program18 { public static void...
Following are the test cases Test cases Result Status makeOutWord(<<>>,Yay) <<Yay>> OK makeOutWord([[]],Word) [[Word]] OK makeOutWord([((JAVA))] ((JAVA)) OK Java solution package...
Following are the test cases Test cases Result Status stringE(Hello) true OK stringE(Heelele) false OK stringE(Heelle) true OK Java solution package test; public class Program16 { public static void...