Q1. Can you write a sample code that will count the number of “A”s in a given text “AAA rating“? Show both iterative and recursive approaches?
A1.
Iteration:
A for loop to traverse through each character of the String “AAA rating”,
…
Q1. Can you write a sample code that will count the number of “A”s in a given text “AAA rating“? Show both iterative and recursive approaches?
A1.
Iteration:
A for loop to traverse through each character of the String “AAA rating”,
…
This tutorial extends SonarQube with Maven Tutorial – Code Quality for Java developers to use Jacoco for tracking unit test coverage. Jacoco is the default code coverage tool that gets shipped with SonarQube. SonarQube can also be configured to use Cobertura as the code coverage tool.
…
Q1.Find the first non repeated character in a given string input using Java 8 or later?
A1.Extends Find the first non repeated character in a given string input with Java 8 functional programming.
For example, an input string of “stress”
…
Q1. What is BDD? A1. BDD is principally an idea about how software development should be managed by both business interests and technical insight. Test-driven development focuses on the developer’s opinion on how parts of the software should work. Behavior-driven development focuses on the users’ opinion on how they want...
There is no other way to pass the Java coding tests other than practicing. I have failed Java coding tests due to lack of practice. How often do you get work with tree and graph data structures? Ho often do you work with algorithms?
50+ Java coding practice problems Links:
…
Q. Can you write Java code to compute a collection of numbers supplied to it? The computation could be addition, subtraction, etc. Use recursion to compute the numbers. Here are some requirements to take into considerations. 1. It should be flexible enough to convert from Recursion to iteration if required....
Generics in Java can be be a bit tricky to get your head around. Hope the explanation below enhances your understanding of generics. This complements 5 Java generics interview Q&As with examples. Raw List, List <Object>, and List<?> A raw List: is a heterogeneous mixture or a mixed bag that...
To appreciate jBehave, let’s look at a better example here. This example is about a science formula Speed = distance / Time. So, given distance and time, calculate speed given speed and time, calculate distance given speed and distance, … Read more ›...
This extends the jBehave — Behavioural Driven Development (BDD) Q&A to use the same example with jUnit testing. Step 1: Make sure that you have both jUnit and jBehave in your pom.xml file.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<dependency> <groupId>org.jbehave</groupId> <artifactId>jbehave-core</artifactId> <version>3.8</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency> |
Step 2: Refer to Behavioural Driven Development (BDD) for all the jBehave implementation. … Read more ›...
This extends the previous jBehave and BDD tutorials. The story is in a tabular format as shown below. This is an industrial strength example. Step 1: The story file which supplies a list of transactions as an input (i.e. via Given) and validates against a list of transactions that are...
This post extends 8 JMeter Performance testing Interview Q&As to cover JSON HTTP post. Now a days, a single page interactive web sites are very popular, and they post JSON based data back to the server to create a new record or to update an existing record. Step 1: Firstly,...
Q1. What is Hamcrest, and what is its purpose?
A1. HAMCREST is an anagram for MATCHER. The purpose is to match the assertions the BDD (Behavior Driven Development) style. In short, reads better like English statements. So,
Instead of:
|
1 2 3 |
assertEqual(greeterService.greetings(), "Hello World"); |
with Hamcrest,
…
This extends JConsole for debugging deadlocks in Java applications, using jvisualvm that gets shipped with your JDK. Step 1: Java code that creates a dead lock situation by a) thread-0 holding on to lock1 and waiting for the lock2, … Read more ›...
I have a good news, I got job offer. I like to share with you from my bottom of my heart feeling thankful to you.