B2 Tech

Web Dev Snippets

  • Facebook
  • Twitter
  • Google Plus
  • Home
  • Java
    • Core Java
    • Core Java Programs
    • Java Swings
    • JavaFX
  • Web Technologies
    • Angular 10
    • Angular 2
    • Angular 9
    • Boostrap 4
    • CSS
    • Express.js
    • High Charts
    • HTML
    • Javascript
    • Javascript Programs
    • jQuery
    • Mongoose
    • Nodejs
    • Typescript
  • Full Stack Applications
    • CRUD Applications
  • Advance Java/J2EE
    • JSP
    • Servlets
    • JSF
    • Thymeleaf
    • Spring MVC
    • Spring Boot
    • Spring Security
    • JPA
    • Hibernate
    • Struts
    • MyBatis/iBatis
  • Interview Programs
  • Web Services
    • REST Services
    • SOAP Services
  • Testing
  • About
  • Contact

Author - Bushan Sirgur

  • Spring Boot
  • Spring MVC

Spring MVC @ControllerAdvice Annotation with Example

20 hours ago
by Bushan Sirgur
9 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring MVC @ExceptionHandler Annotation with Example

2 days ago
by Bushan Sirgur
7 min read
Add Comment

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...

Continue reading

  • Core Java

Different ways to implement Threads in Java

3 days ago
by Bushan Sirgur
2 min read
Add Comment

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...

Continue reading

  • Core Java

Access Modifiers in Java with Examples

3 days ago
by Bushan Sirgur
4 min read
Add Comment

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...

Continue reading

  • Javascript

Convert JSON String into Javascript Object

4 days ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • Javascript

Convert Javascript Object into a JSON String

4 days ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • CRUD Applications
  • Hibernate
  • JPA
  • REST Services
  • Spring Boot
  • Spring MVC
  • Testing

Spring Boot REST API Testing using JUnit

1 week ago
by Bushan Sirgur
6 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring boot @Bean annotation with example

1 week ago
by Bushan Sirgur
5 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring boot @Autowire annotation with example

1 week ago
by Bushan Sirgur
5 min read
Add Comment

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...

Continue reading

  • Javascript

Top 20 commonly used Javascript array methods with examples

2 weeks ago
by Bushan Sirgur
8 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring boot @RequestMapping annotation with example

2 weeks ago
by Bushan Sirgur
4 min read
Add Comment

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...

Continue reading

  • CRUD Applications
  • Hibernate
  • JPA
  • REST Services
  • Spring Boot
  • Spring MVC

Spring Boot, PostgreSQL, JPA, Hibernate RESTful CRUD API Example

2 weeks ago
by Bushan Sirgur
8 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring boot @ResponseBody annotation with example

2 weeks ago
by Bushan Sirgur
4 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring boot @RequestBody annotation example

3 weeks ago
by Bushan Sirgur
4 min read
Add Comment

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...

Continue reading

  • HTML

HTML Basic Tags Explained with Examples

3 weeks ago
by Bushan Sirgur
4 min read
Add Comment

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...

Continue reading

  • Spring Boot
  • Spring MVC

Spring boot @RequestParam annotation Example

4 weeks ago
by Bushan Sirgur
5 min read
Add Comment

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...

Continue reading

  • REST Services
  • Spring Boot
  • Spring MVC

Spring boot @PathVariable annotation Example

4 weeks ago
by Bushan Sirgur
5 min read
Add Comment

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...

Continue reading

  • Core Java
  • Java Swings

Java Swing display JFrame window at center of the screen

4 weeks ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • Core Java
  • Java Swings

Java Swing display Basic Window example

4 weeks ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • Core Java

Java 8 Stream API collect() method Example

4 weeks ago
by Bushan Sirgur
6 min read
Add Comment

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...

Continue reading

  • Core Java

Example to read the user input using Scanner Class

4 weeks ago
by Bushan Sirgur
3 min read
Add Comment

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...

Continue reading

  • Hibernate
  • JPA
  • REST Services
  • Spring Boot
  • Spring MVC

Spring Boot, Hibernate, JPA and H2 Database CRUD REST API Example

4 weeks ago
by Bushan Sirgur
9 min read
Add Comment

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...

Continue reading

  • Javascript

Complete Javascript String methods with Examples

4 weeks ago
by Bushan Sirgur
3 min read
Add Comment

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...

Continue reading

  • Core Java

5 Different Ways to Create Object in Java

4 weeks ago
by Bushan Sirgur
2 min read
Add Comment

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...

Continue reading

  • CRUD Applications
  • Hibernate
  • JPA
  • REST Services
  • Spring Boot
  • Spring MVC

Spring Boot, MySQL, JPA, Hibernate Restful CRUD API Tutorial [2021]

4 weeks ago
by Bushan Sirgur
9 min read
Add Comment

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...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given an array of ints, return true if the value 3 appears in the array exactly 3 times, and no 3’s are next to each other.

1 month ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given an array of ints, return true if the sum of all the 2’s in the array is exactly 8.

1 month ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given a string and an int n, return a string made of the first and last ‘ n’ chars from the string. The string length will be at least n.

1 month ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given an “out” string length 4, such as “<<>>”, and a word, return a new string where the word is in the middle of the out string, e.g. “<>”

1 month ago
by Bushan Sirgur
1 min read
Add Comment

Following are the test cases Test cases Result Status makeOutWord(<<>>,Yay) <<Yay>> OK makeOutWord([[]],Word) [[Word]] OK makeOutWord([((JAVA))] ((JAVA)) OK Java solution package...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Return true if the given string contains 1 or 3 ‘e’ chars. Otherwise return false.

1 month ago
by Bushan Sirgur
1 min read
Add Comment

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...

Continue reading

1 2 3 … 5 Next

About Author

Bushan Sirgur

Well, I am Bushan Sirgur from Banglore, India. Currently, I am working as a Software Developer in a Service Base Company. I am interested in JAVA/J2EE, Angular 2, JavaScript, jQuery, MongoDB.

View all posts

Support me


Love my tutorials? Please support me by donating:

Newsletter



Recent Posts

  • Spring MVC @ControllerAdvice Annotation with Example 1 month ago
  • Spring MVC @ExceptionHandler Annotation with Example 1 month ago
  • Different ways to implement Threads in Java 1 month ago
  • Access Modifiers in Java with Examples 1 month ago
  • Convert JSON String into Javascript Object 1 month ago
  • Convert Javascript Object into a JSON String 1 month ago
  • Spring Boot REST API Testing using JUnit 1 month ago
  • Spring boot @Bean annotation with example 1 month ago
  • Spring boot @Autowire annotation with example 1 month ago
  • Top 20 commonly used Javascript array methods with examples 1 month ago

Featured Posts

  • Spring MVC @ControllerAdvice Annotation with Example
  • Spring MVC @ExceptionHandler Annotation with Example
  • Different ways to implement Threads in Java
  • Access Modifiers in Java with Examples
  • Convert JSON String into Javascript Object

Most Viewed Posts

  • Angular 2 and Spring REST Simple CRUD Application (16,559)
  • Login Form in JavaFX with MySQL Database (15,745)
  • A Complete CRUD Application with Spring MVC and MyBatis/iBatis (14,197)
  • Calculate AGE based on Date of birth using jQuery Calendar (11,306)
  • Complete CRUD Application in Spring MVC and Hibernate [XML Configuration] (10,961)

Categories

  • Angular 10 (2)
  • Angular 2 (2)
  • Angular 9 (7)
  • Boostrap 4 (9)
  • Core Java (15)
  • Core Java Programs (33)
  • CRUD Applications (33)
  • CSS (12)
  • Express.js (7)
  • Hibernate (12)
  • High Charts (3)
  • HTML (13)
  • Interview Programs (33)
  • Java Swings (4)
  • JavaFX (2)
  • Javascript (13)
  • Javascript Programs (20)
  • JPA (21)
  • jQuery (7)
  • JSP (16)
  • Mongoose (7)
  • MyBatis/iBatis (2)
  • Nodejs (7)
  • REST Services (30)
  • Servlets (2)
  • SOAP Services (1)
  • Spring Boot (42)
  • Spring MVC (23)
  • Testing (1)
  • Uncategorized (2)
Copyright © 2021. Created by Bushan Sirgur. Powered by B2 Tech.
  • Facebook
  • Linkedin
  • Instagram
  • Youtube
  • Github
  • Home
  • Java
    • Core Java
    • Core Java Programs
    • Java Swings
    • JavaFX
  • Web Technologies
    • Angular 10
    • Angular 2
    • Angular 9
    • Boostrap 4
    • CSS
    • Express.js
    • High Charts
    • HTML
    • Javascript
    • Javascript Programs
    • jQuery
    • Mongoose
    • Nodejs
    • Typescript
  • Full Stack Applications
    • CRUD Applications
  • Advance Java/J2EE
    • JSP
    • Servlets
    • JSF
    • Thymeleaf
    • Spring MVC
    • Spring Boot
    • Spring Security
    • JPA
    • Hibernate
    • Struts
    • MyBatis/iBatis
  • Interview Programs
  • Web Services
    • REST Services
    • SOAP Services
  • Testing
  • About
  • Contact
  • Facebook
  • Twitter
  • Google Plus