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

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given a string of even length, return the first half. So the string “WooHoo” yields “Woo”.

4 weeks ago
by Bushan Sirgur
1 min read
Add Comment

Following are the test cases Test cases Result Status firstHalf(HelloThere) Hello OK firstHalf(abcdef) abc OK firstHalf(Word) Wo OK Java solution package test; public class Program13 { public static void...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given an array of ints, return true if one of the first 4 elements in the array is a 9. The array length will be greater than 4.

4 weeks ago
by Bushan Sirgur
1 min read
Add Comment

Following are the test cases Test cases Result Status arrayFront9({1,2,9,3,4}) true OK arrayFront9({9,2,3,4,56}) true OK arrayFront9({2,3,4,5}) false OK Java solution package test; public class Program12...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Write a program to generate Fibonacci series of limit number of elements.

4 weeks ago
by Bushan Sirgur
1 min read
Add Comment

Following are the test cases Test cases Result Status generateFibSeries(5) {0,1,1,2,3} Ok generateFibSeries(7) {0,1,1,2,3,5,8} Ok generateFibSeries(10) {0,1,1,2,3,5,8,13,21,34} Ok Java solution public class Program11...

Continue reading

  • Javascript

3 Ways to Create Javascript Functions

1 month ago
by Bushan Sirgur
1 min read
Add Comment

Hey guys in this post we will discuss the different ways of creating Javascript functions. There are 3 different ways to create javascript functions let’s discuss one by one Three different ways Function...

Continue reading

  • Javascript

3 Different ways to Copy Objects in Javascript

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this post we will discuss the different ways of copying objects in javascript. There 3 different ways that we can copy javascript objects let’s discuss them one by one Three Different ways To copy an object in...

Continue reading

  • Core Java

Java 8 Stream reduce() Example

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this post we will discuss about reduce() of Stream API which is introduced in Java 8. Introduction Many times we need to perform operations where a stream reduces to single resultant value, for example, maximum...

Continue reading

  • Core Java

Java 8 Stream map() Example

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this post, we will discuss everything about map() in Streams which is introduced in Java 8. Introduction map() function returns a stream consisting of the results of applying the given function to the element of...

Continue reading

  • Spring Boot

Create Spring Boot Project in Intellij Community Edition

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this post, we will see how to create a spring boot project in the IntelliJ IDEA community edition. Check out Create spring boot project using Spring Initializr Download IntelliJ IDEA First, download and install the...

Continue reading

  • CRUD Applications
  • JPA
  • REST Services
  • Spring Boot

Spring Data Rest with MySQL database [2021]

1 month ago
by Bushan Sirgur
7 min read
Add Comment

Hey guys in this post, we will discuss how to create spring boot REST API using Spring Data Rest module and we will connect it to the MySQL database. We will create a simple employee management system, and it has the following...

Continue reading

  • Javascript

Arrow function in javascript example

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this post we will learn about the javascript arrow function and some of the examples. What is an arrow function? Javascript arrow function or arrow function expression is a shorter alternative to the regular...

Continue reading

  • Core Java

Most commonly used java string methods

1 month ago
by Bushan Sirgur
5 min read
Add Comment

Hey, guys in this post will discuss the most commonly used java string methods. The string is the most commonly used class while building any java application, this is why the java team has provided several built-in String...

Continue reading

  • Javascript

3 Best ways to remove duplicates from array in Javascript

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in post we will discuss the 3 best ways to remove duplicates from array in javascript. so let’s begin By using Set By using Filter By using ForEach Let’s look at the examples one by one By using...

Continue reading

  • Spring Boot

Create spring boot project using Spring initializr

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this post, we will disucss how to create spring boot project using spring initializr. There are different ways to create spring boot project, Spring initializr is just one of the way to create spring boot...

Continue reading

  • Spring Boot

Create spring boot project in Spring tool suite [STS]

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in post, we will learn how to create spring boot project in STS. There are many ways to create spring boot project, Spring tool suite (STS) IDE also provide an option to create spring boot project. Let’s see the...

Continue reading

  • REST Services
  • SOAP Services

HTTP Status codes with examples

1 month ago
by Bushan Sirgur
6 min read
1 Comment

Hey guys in this post we will discuss the most commonly used HTTP status codes with completed examples. HTTP response status codes indicate whether a specific HTTP request has been successfully completed. HTTP status codes are 3...

Continue reading

  • Spring Boot
  • Spring MVC

Annotations used in Spring MVC [2021]

1 month ago
by Bushan Sirgur
4 min read
Add Comment

Hey guys today in this post i am going explain about Spring, Spring MVC, Spring REST and Spring Boot annotations. So let’s begin.. What is annotation? Annotations are primarily used by code that is inspecting other code...

Continue reading

  • Javascript

Convert javascript object to an Array

1 month ago
by Bushan Sirgur
2 min read
Add Comment

Hey guys in this article we will discuss how to convert Javascript objects into an array. There are scenarios where we need to convert a javascript object into an array and we can easily achieve that using Object class methods...

Continue reading

  • Core Java

Java 8 Stream API sorted() Example

1 month ago
by Bushan Sirgur
4 min read
Add Comment

Hey guys in this post let’s discuss aboutsorted()introduced in Java 8 java.util.stream.Steam interface. On the streams() we can perform some aggregate operations such as filter(), sorted() and map(). In this post...

Continue reading

  • Core Java

Java 8 Stream API filter() example

1 month ago
by Bushan Sirgur
3 min read
Add Comment

Hey guys in this post let’s discuss about filter() introduced in Java 8 java.util.stream.Steam interface. On the streams() we can perform some aggregate operations such as filter(), sorted() and map(). In this post...

Continue reading

  • Angular 10

Angular 10 Structural directive example

2 months ago
by Bushan Sirgur
3 min read
Add Comment

Hey guys in this post we will discuss angular structural directive ngFor. This directive will be used to loop through the items or list inside the view template. let’s look at an example. Assume that we have an array of...

Continue reading

  • Angular 10
  • REST Services

Angular 10 HTTP GET Request Example

2 months ago
by Bushan Sirgur
4 min read
Add Comment

Hey guys in this post we will discuss how to make HTTP GET requests in Angular 10. We will use Fake REST API to make the GET requests. Here is the API endpoint: This API will give the list of users in JSON format. Below is the...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given a string, return a new string where the first and last chars have been exchanged

2 months ago
by Bushan Sirgur
1 min read
1 Comment

Test cases Test cases Expected Result frontBack(abcd) dbca OK frontBack(Bee) eeB OK frontBack(MazE) EazM OK Java solution: public class Program10 { public static void main(String[] args)...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Pass an int array and an int and do a search of the second parameter in the first, and return true/false.

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases Test cases Expected Result searchElement({33,44,21,98,27,94},21) true OK searchElement({1232,432,546,980,984},980) true OK searchElement({3,4,9,87,29},2) false OK Java solution: public class Program9...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given an array of ‘N’ elements .Return the sum of all array elements

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases Test cases Expected Result arraySum({5,5,5,5,5}) 25 OK arraySum({1,3,4,7,8}) 23 OK arraySum({100,200,300}) 600 OK Java solution: public class Program8 { public static void main(String[] args) { int a[]...

Continue reading

  • CSS
  • HTML

Google style login page

2 months ago
by Bushan Sirgur
3 min read
Add Comment

Hello everyone, today in this post I will show you how to design google style login page with HTML and CSS so let’s begin. index.html <!DOCTYPE html> <html lang="en"> <head> <meta...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Accept a string as parameter. Find out how many consonants present in it.

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases: Test cases Expected Result countConsonents(instanceof is for references only) –>[18] 18 OK countConsonents(Object Oriented) –>[8] 8 OK countConsonents(Design Patterns88)...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Pass a string as parameter. Find out how many vowels present in it

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases: Test cases Expected Result countVowels(instanceif is for references only) 11 OK countVowels(Object Oriented) 6 OK countVowels(Design Patterns) 4 OK Java solution: public class Program6 { public static...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Given two strings, append them together (known as “concatenation”) and return the result.

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases: Test cases Expected Result stringConcat(Hello,World) Hello World OK stringConcat(Code,ranch) Code ranch OK stringConcat(Web,Application) Web Application OK Java solution: public class Program5 { public...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Return true if the given non-negative number is a multiple of 3 or a multiple of 5

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases: Test cases Expected Result or35(15) true OK or35(8) false OK or35(12) true OK Java solution: public class Program4 { public static void main(String[] args)...

Continue reading

  • Core Java Programs
  • Interview Programs
  • Javascript Programs

Test whether the number is divisible by 7 or not

2 months ago
by Bushan Sirgur
1 min read
Add Comment

Test cases: Test cases Expected Result isDivisibleBy7(17) false OK isDivisibleBy7(77) true OK isDivisibleBy7(12) false OK Java solution: public class Program3 { public static void main(String[] args)...

Continue reading

Previous 1 2 3 4 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

  • Different ways to implement Threads in Java 2 months ago
  • Access Modifiers in Java with Examples 2 months ago
  • Convert JSON String into Javascript Object 2 months ago
  • Convert Javascript Object into a JSON String 2 months ago
  • Spring Boot REST API Testing using JUnit 2 months ago
  • Spring boot @Bean annotation with example 2 months ago
  • Spring boot @Autowire annotation with example 2 months ago
  • Top 20 commonly used Javascript array methods with examples 2 months ago
  • Spring boot @RequestMapping annotation with example 2 months ago
  • Spring Boot, PostgreSQL, JPA, Hibernate RESTful CRUD API Example 2 months ago

Featured Posts

  • Different ways to implement Threads in Java
  • Access Modifiers in Java with Examples
  • Convert JSON String into Javascript Object
  • Convert Javascript Object into a JSON String
  • Spring Boot REST API Testing using JUnit

Most Viewed Posts

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

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 (40)
  • Spring MVC (21)
  • 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