Thursday, April 10, 2025

Top 10 Servlet Interview Question Answers for Java JEE Developers

This time its servlet interview questions, I was thinking about what to pick for my interview series and then I thought about J2EE and Servlet is my favorite in that space. Servlet is an important part of any J2EE development and serves as a Controller on many web MVC frameworks and that’s why it’s quite popular on J2EE interviews. These Servlet questions are based on my experience as well as collected by friends and colleague and they are not only good for interview practice but also shows a new direction of learning for anyone who is not very familiar with servlet technology.

How to close telnet terminal in Linux and Windows (quit, exit not working)? Example

The telnet is one of the most useful Linux networking commands, which is used to check if a server is listening on a particular port and it's whether up and running or not, but it's a little bit tricky to use, especially, if you are not using it on daily basis. Though I have used telnet before, when I use it after a long time, I actually forgot how to close the telnet terminal and how to get out of it. I tried every possible  Linux commands I can think of which is used to close, cancel a command, or exit from VIM editor in UNIX, like  Ctrl + C, quit, exit, q! and even the escape character '^]', only to realize that nothing is working. It may sound silly that an experienced developer cannot even come out of a telnet terminal but this is a true story. 

10 Examples to Read a Text file in Java [UPDATED]

The Java IO API provides two kinds of interfaces for reading files, streams and readers. The streams are used to read binary data and readers to read character data. Since a text file is full of characters, you should be using a Reader implementations to read it. There are several ways to read a plain text file in Java e.g. you can use FileReader, BufferedReader or Scanner to read a text file. Every utility provides something special e.g. BufferedReader provides buffering of data for fast reading, and Scanner provides parsing ability. 

Why use PreparedStatement in Java JDBC? Example Tutorial

PreparedStatement in Java is one of several ways to execute SQL queries using JDBC API. Java provides Statement,
PreparedStatement and CallableStatement for executing queries. Out of these three, Statement is used for general-purpose queries, PreparedStatement is used for executing a parametric query, and CallableStatement is used for executing Stored Procedures. PreparedStatement is also a popular topic in java interviews. Questions like Difference between Statement and PreparedStatement in Java and How to prevent SQL Injection attacks in Java are popular java interview questions.

How to encode decode String in Java base64 Encoding? Example Tutorial

Encoding and Decoding of String in Java using base64 are extremely easy if you are using Apache commons code open source library. it provides convenient static utility methods Base64.encodeBase64(byte[]) and Base64.decodeBase64(byte []) for converting binary data into base64 encoded binary Stream and then decoding back from encoded data in base64 encoding mechanism. Many times we need to encode sensitive data be it binary String format transferring over a socket or transferring or storing data in XML files. Though there are other open-source libraries available that provide support to encode any String into base64 like MimeUtil from javax.mail package but Apache commons-codec package is really handy and doesn't add a lot of extra stuff. Its API is also very neat and clean. In this article, we will see how to encode and decode String into base64 encoding.

How to fix DATALOSS Advisory in Tibco Rendezvous or Tibco RV? Example

Understanding DATALOSS Advisory in Tibco Rendezvous
While working with TIBCO rendezvous you guys must have been faced the problem of DATALOSS and might be aware of its severe consequences and in the worst case how it can cause TIBCO Storm (A situation where TIBCO publisher bombards network with publishing so many messages and exhaust all network bandwidth of WAN links resulting in a complete breakdown of network lines and communication).  This Tibco Tutorial is in continuation of my Tibco Tutorial series and in this short TIBCO tutorial I will explain what is DATA LOSS in Tibco and How we can minimize or prevent DATALOSS in Tibco RV.

15 Financial Information Exchange (FIX) Protocol Interview Questions Answers for Experienced

Financial Information Exchange (FIX) Protocol Interview Questions and Answers
Some more Fix protocol interview question , I will put answer along when I'll get some time for now just questions :)  Now I have updated it with answer, Please let me know if you have any doubt, or you have other questions, you can also contribute by any question asked during any FINANCIAL INFORMATION EXCHANGE (FIX)  protocol interview.

Wednesday, April 9, 2025

How to add or list certificates from keystore or truststore in Java? Keytool Example Tutorial

How to add certificates on keystore in Java is the primary question when you start working on SSL connection and a simple answer is keytool utility in Java is used to add or list Certificates into keystore. SSL is the industry standard for secure communication between two parties e.g. client and server. SSL offers two benefits, it encrypts data transferred between client and server to make it hard for someone to access and understand in between and SSL also verifies the identity of two parties in communication, and certificates are used for that purpose. SSL Setup in Java comes during various processes e.g. Setting up SSL on tomcat, configuring messaging over SSL, or JDBC over SSL are some examples of tasks where you need to deal with keyStore, certificates, and trust stores.

How to Format and Display Number to Currency in Java - Example Tutorial

Displaying financial amounts in the respective currency is a common requirement in Java-based E-commerce applications. For example, if you are selling products on-line globally, you will show price of products in their local currency rather than USD or some other currency. Storing price in every currency is not a good option because of maintenance, and more realistically fluctuation in exchange rates. That's why many of these applications prefer stores price of books, electronic goods, or whatever product they are selling in USD, and the responsibility of converting that price to local currency and displaying is left to client-side code. If your client is a Java-based client e.g. Swing GUI, Java FX client, or a JSP web page, you can use java.text.NumberFormat class to format currency in Java.

5 Example of sort command in UNIX or Linux - Tutorial

Sorting is one of the essential tasks we always need to perform and UNIX or Linux has great support for sorting by using sort command. No matter what kind of shell script you are writing or you are looking for some information or reports many times you need to sort the output of one command or a set of line, with a combination of the sort with find command and grep in UNIX you can handle support request and report quite easily. In this UNIX sort command tutorial, we will see how we can use sort command in UNIX to achieve our sporting goal. This tutorial contains some of the practical example of sort command for sorting data in UNIX. With the use of “unique” and “sort” command, you can remove duplicates and present a sorted data in UNIX.

How to Fix "The system cannot find the path specified." Error in Command Prompt? Example

Recently I was trying to run the Apache Tomcat server from the command prompt to test my Java web application on localhost, only to find the "The system cannot find the path specified" error in command prompt. I haven't seen this error before so I was wondering whether tomcat is throwing or something is wrong with my system's PATH environment variable.  In order to start the tomcat server, I was running the catalina.bat file as tomcat/bin/catalina.bat start and it wasn't starting the Tomcat at all, instead, it was keep throwing "The system cannot find the path specified." error as shown below:

How to Convert char to String in Java? Example Tutorial

There are multiple ways to convert char to String in Java. In fact, String is made of a Character array in Java, which can be retrieved by calling the String.toCharArray() method. Char is a 16 bit or 2 bytes unsigned data type in java mainly used to store characters. You can convert a single character into a String for any purpose in Java in more than one way. I thought about this article while writing how to convert Integer to String in Java but t it took a little longer to get this post completed. In this Java tutorial, we will see different ways to convert a character into a String in java with code Examples.

Difference between TIBCO RVD and RVRD? Rendezvous daemon vs Rendezvous Routing Daemon

RVD (Rendezvous daemon) vs RVRD (Rendezvous Routing Daemon)
RVRD (Rendezvous Routing Daemon) are simply process owned by middleware or network teams which listens to multicast traffic locally and transmit it to another RVRD counterpart (another host) using TCP. This remote host than re multicast this traffic to their own network. So essentially it used to bridge two different regional networks e.g. London and New York etc.

What is FIX Engine in FIX Protocol? Examples

FIX Engine is in the heart of any  FIX protocol-based electronic trading application. W, whenever we discuss FIX protocol we talk about FIX engines, the performance of different Fix engines, support of different FIX versions on FIX engine etc. but on a basic level, we definitely like to know what is an FIX engine and what does FIX Engine do in FIX protocol. In this article, we will try to touch base on such questions with an independent view on FIX engines e.g. What is an FIX engine? Why you need FIX engines? 

Tuesday, April 8, 2025

Can You Overload or Override Static methods in Java? Example

Can a static method be overridden in Java, or can you override and overload static method in Java, is a common Java interview questions mostly asked to 2 years experienced Java programmers. The answer is, No, you can not override static method in Java, though you can declare a method with the same signature in a subclass. It won't be overridden in the exact sense, instead, that is called method hiding. But at the same time, you can overload static methods in Java, there is nothing wrong with declaring static methods with the same name, but different arguments. Some time interviewer also ask, Why you can not override static methods in Java? The answer to this question lies in the time of resolution.

Error: Could not find or load main class in Java [Solved]

Error: Could not find or load main class HelloWorld comes when you are trying to run your Java program using java command with the main class as HelloWorld but Java is not able to find the class. In order to solve this error, you must know how Java find and loads the classes, that's a little bit complex topic for beginners, but we will touch the same base here. For the curious reader, I would suggest reading my post How Classpath works in Java, a must read for a beginner. For now, you just remember that there is an environment variable called CLASSPATH which includes directories where Java looks for all class files and if it doesn't find your main class there then it throws "Error: Could not find or load main class XXX", where XXX is the name of your main class.

3 Ways to Solve "No JVM installation found. Please install a 64-bit JDK" - Android Studio Example

You are an enthusiastic Java programmer who just learned about developing Android apps in Java. To start with you have installed Android Studio, which is the official Integrated Development Environment (IDE) for Android app development, based on IntelliJ IDEA, but as soon as you click on the Android Studio Desktop Icon to start Android Studio you are getting "No JVM installation found. Please install a 64-bit JDK" error? How do you solve this problem? Well, even though the error message is the same, every problem is different depending upon your machine, the Java version, whether your desktop or laptop has 32-bit or 64-bit OS e.g. Windows 10 or Windows 11. Whether you have installed 32-bit Java or 64-bit JDK e.g. JDK 21.0 and what is the value of the JAVA_HOME environment variable or whether you have defined it or not.

How to find and kill a Process Listening on a port in Linux? netstat and lsof command examples

In Linux, many times, you want to find out the PID of a process that is listening on a port e.g. if multiple tomcat servers are running on a host and you have to kill that process, but in order to kill that process you need the process id, how do you find the PID of the tomcat listening on port 8080? There are many Linux commands to find the process using a specific port, but I'll share what I use. I always use the netstat command with -p option, which displays the process id of the process listening on a port. Btw, netstat is not the only command to find all processes using a particular port, you can also use the lsof command for the same purpose.

2 Ways to Combine Arrays in Java? Integer, String Array Copy Example

There are multiple ways to combine or join two arrays in Java, both for primitive like int array and Object e.g. String array. You can even write your own combine() method which can use System.arrayCopy() to copy both those arrays into the third array. But being a Java developer, I first looked in JDK to find any method which concatenates two arrays in Java. I looked at java.util.Arrays class, which I have used earlier to compare two arrays and print arrays in Java, but didn't find a direct way to combine two arrays. Then I looked into Apache Commons, ArrayUtils class, and bingo, it has several overloaded methods to combine int, long, float, double, or any Object array.

How TIBCO Certified Messaging works? Example Tutorial

This is in continuation of my previous Tibco tutorial. Tibco RV is the most widely used middleware in the enterprise world heavily used in banking and many global investment banks rely on Tibco RV for their high-speed messaging requirements. it's used by many trading applications to receive high-speed data e.g. Market data. in reliable mode Tibco provides reliable delivery of data but not guaranteed means if the sender sends data to the receiver via Tibco multicast network, Tibco tries best to deliver that data to the receiver but there is no guarantee, data could be lost if the receiver is too busy to receive it if the receiver is not running or a receiver is hung. In some cases, it's possible to recover lost data by sending "Resend Request".

How to Replay Messages in FIX Protocol? Example Tutorial

Replaying messages in FIX protocol
In FIX Protocol, two FIX engines communicate with each other using FIX messages and every FIX messages is assign with unique sequence number denoted by tag 34. Apparently every FIX engine has two sequence numbers Incoming Sequence Number (which FIX engine is expecting from a counter party) and Outgoing Sequence Number (which FIX engine is sending to counterparty). This sequence numbers along with rules specified in FIX protocol technical specification ensures that no FIX engine should lose any FIX messages in the event of any disconnect.

Monday, April 7, 2025

Why Catching Throwable or Error is Bad Idea in Java?

We often hear advice that catching Throwable or Error is bad practice and Java developer should avoid catching these, but have you thought Why? If the language allows you to catch anything which is an instance of java.lang.Throwable, then what is the problem of catching them or their subclass java.lang.Error? If they are bad, shouldn't Java itself has prohibited them from catching?  Well, this all looks good on theory, but not in real-world programming. As I said before in Java Exception best practices post, Ideally you should never catch Throwable or in particular Error

File permissions in UNIX Linux with Example >> Unix Tutorial

Whenever we execute ls command in UNIX you might have observed that it list file name with lot of details e.g.
stock_options:~/test ls -lrt
total 8.0K
-rw-r--r-- 1 stock_options Domain Users 1.1K Jul 15 11:05 sample

If you focus on the first column you will see the file permissions as "-rw-r--r--" this is made of three parts user, group, and others. The user part is permission relate to user logged in, group is for all the members of the group and others is for all others. also each part is made of three permissions read, write and execute so "rw-" means only "read and write" permission and "r--" means read-only permission.

3 Tips to Fix java.lang.ArrayindexOutOfBoundsException: 1 in Java Programs - Example Tutorial

The error ArrayIndexOutOfBoundsException: 1 means index 1 is invalid and it's out of bounding i.e. more than the length of the array. Since the array has a zero-based index in Java, this means you are trying to access the second element of an array which only contains one element. The ArrayIndexOutfBoundsException comes when your code, mostly for loop tries to access an invalid index of the array. If you have worked in C, C++ then you will notice this difference between array in C and Java. You simply cannot access invalid array index in Java i.e. indexes which are less than zero and more than the length of the array.

How to Check or Detect Duplicate Elements in Array in Java? Example Tutorial

Detecting duplicate elements in Java array is another programming interview question I like. There could be a lot of ways you can check if your array contains duplicate elements or not and sometimes you discover a unique way of checking duplicates by asking this question on Java interview. The beauty of this question is that it has an endless number of follow-up question so if interviewee gets through this question you can ask to him about time complexity and space or to improve his algorithm to make it fast .you can even ask to find those duplicate elements in Array which even can go from one duplicate to many repeating elements in Array. As I said you can really test programming skills around an array of a Java programmer.

How to create and execute JAR file in Java – Command line Eclipse NetBeans Example

Creating JAR file in java from the command prompt is always been little tricky for many of us even if IDE like Netbeans and Eclipse provide support to export java program as JAR file simply because we don’t create jar often and not familiar with manifest file or jar command as a whole. JAR file in Java is a kind of zip file that holds all contents of a Java application including Class files, resources such as images, sound files, and optional Manifest files. JAR stands for Java Archive and provides a platform-independent deliverable for java programs, libraries and frameworks. you can execute the same jar file in any operating system e.g. Windows 7, Windows 8, Macintosh, or Linux.

Difference between Tibco EMS and Tibco RV? Answer

Both of them are products from Tibco and are used extensively across global investment banks for the front end to back end communication or server to server communication. though they have differences in the manner they have designed and the specification they are based upon. Tibco RV stands for Tibco Rendezvous which is based on proprietary Tibco protocol (TRDP/PGM) developed by the company. They have provided API in almost all major programming languages and this is a preferred choice if you need high-speed communication e.g. publishing market data updates etc. 

What is FIX Session and Admin Messages in FIX Protocol? Tutorial

FIX Protocol Session or Admin messages tutorial
I have been working on FIX protocol for almost 5 years when I started working on FIX protocol I looked upon internet for some good tutorial which could supplement or complement lengthy FIX protocol specification there was nothing at that time so when I started my blog I thought to write about my own experience in FIX protocol as short, clear and concise tutorial format. Since I like question-answer type of knowledge sharing too I have written some blog post on FIX protocol Interview questions you may find it interesting. 

Sunday, April 6, 2025

What is GET and POST method in HTTP and HTTPS Protocol? Answer

GET and POST method in HTTP and HTTPS are two most popular methods used to transfer data from client to server using  HTTP (Hyper Text Transfer Protocol)  protocol. Both GET and POST can be used to send requests and receive response but there are significant differences between them. The difference between GET and POST in HTTP or HTTPS is also a popular interview question in JSP and any web programming interview. Since HTML is independent of any web server technology like Java, ASP or PHP and HTTP is core protocol in space of the internet, the importance of a clear understanding of GET and POST method can not be ignored.

How to Fix javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException in Java? Example

If you are working in a Java web or enterprise application that connects to any other web server using HTTPS you might have seen the "javax.net.ssl.SSLHandshakeException". This is one of the particular cases of that error. If you know how SSL and HTTPS work that when a Java client connects to a Java server the SSL handshake happens. In these steps server return certificates to confirm its identity, which the client validates against the root certificate he has in its truststore. If Server returns a certificate that cannot be validated against the certificates a browser or Java client holds in its truststore then it throws the "sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target".

10 Examples of Vim or VI editor in UNIX and Linux

Vim or VI editor tutorial in UNIX 
VI Editor is like notepad in UNIX but it’s extremely powerful and has a sophisticated feature to work as complete IDE. No matter which version of UNIX you are working or which flavor you are using you always find either VI editors or VIM there. VI is a very large topic and I am not covering every aspect of it what I am sharing here is some examples of using VI editor in UNIX or Linux. most of the time we use only 10% of VI editor and never know 90% of it, to be frank, I also don't know many of VI features by heart but I always search for it, see people working in VI and learn from their experience as well.

5 JSTL Core IF Tag Examples in JSP - Tutorial

<c:if>  or if the tag of JSTL core tag library in JSP is one of the most versatile and useful tags. JSTL if tag allows you  to test for a condition, like checking for a particular parameter in requestScope, sessionScope, or pageScope. You can also check any parameter in request parameters and headers or can check for a variable in JSP page using <c:if> tag. JSTL if tag helps a lot to reduce the amount of Java code from JSP  page and if used, along with expression language JSTL core tag library, can remove almost all Java code from JSP files. Earlier we have seen examples of JSTL foreach tag and JSTL core set tag and this JSP JSTL tutorial is based on if the tag of the JSTL core tag library.

Difference between URL-rewriting URL-encoding in Servlet JSP? Answer

URL-rewriting vs URL-encoding in Servlet JSP
The main difference between URL-rewriting and URL-encoding is that URL-rewriting is a technique to maintain user session if cookies are not enabled on the client browser or browser doesn't support cookie while URL-encoding is a way to pass a string to the server containing special characters by converting special characters like space into some other characters like +. People often confuse between URL encoding and URL rewriting because of there names which sound quite similar for new guys but functionality wise they are totally different to each other, Also servlet encodeURL() method adds more confusion because its sounds like its used for URL Encoding but indeed used for URL Rewriting.

Saturday, April 5, 2025

Tibco RV Tips and Commands with Examples

This is the third post on series of "Tibco tutorials" , In this article, I am posting some of the most useful commands which I used while working in tibco rv in many application , they are extremely useful and must be in developers top of head who is working in tibco rv.  Before writing these "tibco tutorial" series I looked for some introductory simple TIBCO tutorial which explains concept of tibco rv in simple word and give us working knowledge of TIBCO but I did not found any. TIBCO is most heavily used middleware solution on enterprise world and form backbone of many large enterprise including global banks.

How to deal with Common FIX Session Connection Issues? Solutions

FIX Protocol Session Connectivity
Hi guys, in this post I would like to share my experience with financial information exchange (FIX) Connections which is essential to set up FIX connectivity for trading purposes. Financial information exchange (FIX) Connections are used in both Client Connectivity and Exchange connectivity space (in case exchange supports financial information exchange (FIX) Protocol or you are connecting to any broker via FIX  Protocol).

InOrder traversal of Binary tree in Java using Recursion and Iteration - Example Tutorial

This is the second article about tree traversal algorithms using Java. In the first part, we have seen the pre-order algorithm for visiting all nodes of the binary tree and today we'll learn about the InOrder traversal. As I told you before, unlike array and linked list, the binary tree has several ways of traversal. The traversal algorithms are broadly divided into depth-first and breadth-first traversal algorithms depending upon how the algorithm actually works. As the name suggests, depth-first explores binary tree towards depth before visiting sibling, while breath first visits all nodes in the same level before going to next level, hence it is also known as level order traversal. 

How to Print all Leaf Nodes of Binary tree in Java - Recursion and Stack Examples

Binary tree based questions is very common in Java or any other programming job interviews. One of the frequently asked binary tree questions is "write a program to print all leaf nodes of a binary tree". In order to solve this problem, you must know what is a leaf node? A leaf node in a binary tree is a node whose left and right child is null. They are actually the last nodes of any binary tree. In a typical programming interview, you would be given a binary tree and asked to write a program to print all leaf nodes. Usually, all binary tree related questions can be solved easily using recursion because a tree is a recursive data structure, but you should also know how to solve them without recursion.

Top 10 Maven Plugins Every Java Developer Should Know

In the last couple of years, Maven has become the de-facto build tool for Java applications. Though there are challenges that exist from tools like Gradle, I think the dominance of Maven will help it to win the final battle. When I started with Maven, I was happy with just dependency management but then I come to know about maven plugins which let you customize your build-up to the level you can do with ANT. These plugins provide true power to Maven to automate most of the build-related tasks like compilation, testing, packaging, deployment, and even committing the source code into the remote source repository.

ThreadLocal Memory Leak in Java web application - Tomcat

ThreadLocal variables are infamous for creating memory leaks. A memory leak in Java is the amount of memory hold by an object which is not in use and should have been garbage collected, but because of unintended strong references, they still live in Java heap space. There are many ways memory leak can be caused in Java but when this memory leak is caused due to the ThreadLocal variable, it’s referred to as ThreadLocal memory leak. In our last post about the ThreadLocal variable, we have seen How the ThreadLocal variable can make SimpleDateFormat thread-safe and also raised points that in a managed environment like the J2EE application server or a web servers like Tomcat, Jetty, WebSphere or Weblogic use of ThreadLocal should be avoided.

How to get max memory, free memory and total memory in Java? Example

Getting free memory, total memory and max memory on JVM is using Runtime class in Java. and many java programmers is interested to know whether they have any relationship with JVM argument -Xms and -Xmx which is used to specify starting heap size and maximum heap size of JVM. I have touched this on 10 Points on Java heap and how to set heap size in ANT and Maven but here we will see some way to find out starting and maximum heap size from Java program.

Tibco Tutorial: Fundamentals of Tibco RV Messaging - Network, Service, and Daemon on RVD

This is in continuation of my tibco tutorial series where I will discuss tibco rv on the application developer's point of view as middleware or messaging solution.As discussed in earlier tibco tutorials, tibco is used for communicating between two systems e.g. client and server or server to server, here we will see some of the basic terms used in tibco rv  world.

Top 20 FIX Protocol Interview Questions and Answers

Its' been a while since I shared FIX protocol interview questions. So here is the new set of top 20 FIX protocol interview questions. These are the question which is mostly asked in while interviewing any developer or support professional which has some knowledge of FIX protocol. Given the number of clients, brokers and exchanges using FIX protocol it’s really a great thing to have on your resume and can land you some very well paying jobs in the street. 

Friday, April 4, 2025

How to set JAVA_HOME environment in Linux, Unix and Windows? Example

JAVA_HOME is a system environment variable that represents the JDK installation directory. When you install JDK in your machine (Windows, Linux, or UNIX) it creates a home directory and puts all its binary (bin), library(lib), and other tools. In order to compile the java program "javac" tool should be in your PATH and in order to get that in PATH we use the JAVA_HOME environment variable. Many tools like ANT and web servers like tomcat use JAVA_HOME to find java binaries. In this article, we will see how to set the JAVA_HOME environment variable in the different operating systems including Windows (Windows 7, Vista, XP) and Linux (Unix).

JSTL Set tag examples or <c:set> in JSP – Java J2EE Tutorial

JSTL set tag or <c:set> also called as JSTL Core tag library is a good replacement of <jsp:setProperty> jsp action which lacks lot of functionality and only allow you to set bean property. you can not set Map's key-value or create a scoped variable by using <jsp:setProperty>. jstl <set> tag allows you to do all the stuff related to setting or creating variables or attributes. by using JSTL <c:set> tag you can :

What is Constructor Overloading in Java? Example

Constructor overloading in java allows having more than one constructor inside one Class. in the last article we have discussed method overloading and overriding and constructor, overloading is not much different than method overloading. Just like in the case of method overloading you have multiple methods with the same name but different signatures, in Constructor overloading, you have multiple constructors with a different signature with the only difference that Constructor doesn't have a return type in Java. That constructor will be called as an overloaded constructor.

Why use Memory Mapped File or MapppedByteBuffer in Java? Example

Memory Mapped Files in Java is a rather new java concept for many programmers and developers, though it’s been there from JDK 1.4 along with java.nio package. Java IO has been considerably fast after the introduction of NIO and memory-mapped file offers the fastest IO operation possible in Java, that's the main reason of Why high-performance Java application should use Memory Mapped files for persisting data. It's already quite popular in the high-frequency trading space, where the electronic trading system needs to be super fast and one-way latency to exchange has to be on the sub-microsecond level.

How to Fix Tibrv Errors and Exceptions? Examples

While working with tibco rv for many years I found that Tibco errors are mysteriously difficult to diagnose for a newcomer and minor differences between syntax and semantics along with network specifics lead to some strange errors. here I am putting the most common error which I have faced mainly because of some silly mistake in syntax and spent hours to figure out the exact cause during my initial days. This list is by no means complete and I would encourage to put any other error you have encountered to make this list more useful. Any suggestions, input feedback always welcome.

How to add Primary key into a New or Existing Table in SQL Server? Example

Since a primary key is nothing but a constraint, you can use the ALTER clause of SQL to add a primary key into the existing table. Though it's an SQL and database best practice to always have a primary key in a table, you will often find tables that don't have a primary key. Sometimes, this is due to lack of a column that is both NOT NULL and UNIQUE (constraint require to be a primary key), but other times purely due to lack of knowledge or lack of energy. If you don't have a column that can serve as the primary key, you can use identity columns for that purpose. Alternatively, you can also combine multiple columns to create composite primary keys, like you can combine firstname and lastname to create a primary key name, etc.

Difference between Session Level Reject and Business message Reject in FIX Protocol? Answer

FIX Protocol tutorials: Difference between Session Level Reject and Business message Reject
In FIX protocol there are multiple ways of rejecting message some of them are using an Execution Report (MsgType=8) and ExecType=8 to reject a FIX message if it can not be acceptable by exchange e.g. Sending order for an exchange and link between broker and exchange is down. Another way of rejecting message is OrderCancelReject (FIX MsgType=9) which is used to reject amend (OrderCancelReplace message FIX MsgType 35=G) and cancel (OrderCancelRequest FIX MsgType=F) messages if its not possible to modify or cancel original message e.g. Sending Cancel request to an already filled order will be rejected by OrderCancelReject message in FIX protocol.

Wednesday, April 2, 2025

Why non-static variable cannot be referenced from a static context? Example

"non-static variable cannot be referenced from a static context" is the biggest nemesis of someone who has just started programming and that too in Java. Since the main method in java is the most popular method among all beginners and they try to put program code there they face "non-static variable cannot be referenced from a static context" compiler error when they try to access a non-static member variable inside the main in Java which is static. if you want to know why the main is declared static in Java see the link.

Top 5 Java Forums for Programmers and Developers

When you face a Java problem where do you go? StackOverflow, Coderanch, or Official Java forums? Yes, there are lots of online resources to help a Java programmer when he is stuck. Being one of the most popular programming languages ever, Java has a huge community. There are lots of blogs, websites, and forums to help you with the minute detail of Java programming. It doesn't matter if you are a beginner facing a problem or an expert looking for the best possible way to do certain things in Java, forums always provide good support.

How to find if JVM is 32 or 64 bit from Java program? Example

You can find JVM bit sizes like 32 bit or 64 bit by using either running java command from the command prompt or by using System.getProperty() from Java program. The question is why do you want to know hardware or platform configuration while writing Java code which is supposed to write once and read anywhere(32 bit, 64 bit, etc)? Yes we don't really need to know whether JVM is 32 bit or 64 bit more often but there are many situations when this matters

Java Best Practices for Method Overloading? Examples

You need to be careful while overloading a method in Java, especially after the introduction of autoboxing in Java 5. Poorly overloaded method not only adds confusion among developers who use that but also they are error-prone and leaves your program at compiler's mercy to select proper method. One of the best examples of a poorly overloaded method is the removal method of ArrayList. There are two versions of remove, first, one which takes an Object as argument i.e. remove(Object element), and the second one, which takes an index as argument i.e. remove(int index).

How to take array input from command line in Java ? Scanner Example

There is no direct way to take array input in Java using Scanner or any other utility, but it's pretty easy to achieve the same by using standard Scanner methods and asking some questions to the user. For example, if you want to take a one-dimensional array of String as input then you can first ask the user about the length of the array and then you can use a for loop to retrieve that many elements from the user and store them in an array. You can use the next() to take a String input from the user. Similarly, if you need to take an integer array or double array, you can use the nextInt() or nextDouble() method of the Scanner class.

Top 10 FIX Message Interview Questions Answers for Beginners

FIX (financial information exchange) protocol is the global protocol used for Electronic trading of different asset classes e.g Equity, Fixed Income FX (foreign exchange) , Derivatives Futures and Options and its knowledge is essential to understand Electronic trading and FIX messages. I have listed some of the very common but informative questions asked in FIX protocol interview question, this list is by no means complete and only contains questions on top of my mind, I would encourage reader to post any question they have been asked and I will include on this list.

How to view FIX Messages in a Readable format? Free Online FIX Message Viewer Tool

It's been a long time, I wrote anything related to FIX protocol, my last article was about FIX protocol dictionaries, also known as Fixionnary, one of the most important tools of the trade for Java developers and support personnel working in FIX. Today, I am going to share another useful tool called FIX Log Viewer, which allows you to view FIX engine logs in a much more readable format.

How to use String.codepoint() method in Java? Example Tutorial

CodePoint method in String is used to get Unicode code point value at index or before the index.  In String class we have a lot of utility methods for dealing with String like Split, replace, and SubString method but here I am discussing a relatively lesser-known method codePointAt(), codePointCount(), and codePointBefore(), but before going deep about this method lets first understand what is of the code point, what exactly CodePoint method does and how to use CodePointAt, CodePointBefore methods using java code example.

Codecademy Learn Java Review - A Free Java Course to Learn Coding Online

Hello guys, you may not know but Codecademy has a free Java course that is perfect for beginners, almost 2.3 million students have already registered. Does it say anything about the popularity of Java? Given Java provides a really good prospect of getting a job and there is more than one reason to learn Java, I am not surprised by the number of students registered. Codecademy has always been a superb source to learn new programming languages or technology from the start. I first started using Codecademy for learning JavaScript using their free JavaScript course and then I used it a couple of months back to improve my Python and Linux command skills.

Top 8 Python Libraries for Data Science and Machine Learning - Best of Lot

Hello guys, today I am going to talk about something which is not related to Java but a very interesting technology development that is happening around, and you simply can't afford to miss out on this opportunity. Yes, you guessed it right, I am talking about Machine learning, Artificial Intelligence, and Deep Learning. There is a good chance that you might have already heard about them and even started learning them. You may be either from Python camp or learning R programming for the sake of machine learning. When I started my journey of Machine learning and Data Science, I had to first make a choice about choosing the right programming language as both R and Python were doing great.

How to increase length of existing VARCHAR column in SQL Server? Example Tutorial

You can increase the length of a VARCHAR column without losing existing data in SQL Server. All you need to do is execute the following ALTER TABLE statements. Though, you need to specify NULL or NOT NULL constraint explicitly, depending upon your data.

Here is the SQL command you can use to increase the length of a VARCHAR column in SQL Server:

ALTER TABLE Books ALTER COLUMN title VARCHAR (432)

This command increases the length of the title column of the Books table to 432 characters. You can use the same command to increase the length of CHAR, NCHAR, or NVARCHAR columns as well.

Top 10 Computer Programming, Artificial Intelligence, and Sci-Fi Movies for Programmers and Tech geeks

Hello guys, being a computer programmer, I love movies that are based on programmers' life, work, and concept. Thankfully Hollywood is no short of films based on computers, programming, and geeky technical stuff. Another day, I was pretty bored, and when I look back to my DVD collection, I found Inception, Matrix Reloaded, and The Social Network, this all movies are in some way related to computers and technology, which strike me the idea to publish my list of Top 10 Computer programming movies.

How to Crack Spring Professional Develop (2V0-72.22) Exam - Latest Spring Certification for Java Programmers

Ever since VmWare, the company behind the Spring framework made the mandatory Spring training optional (see here), I have received many queries from experienced Java developers who are interested in doing Spring certifications. This move from VmWare has suddenly made the Spring certification affordable for many experienced Java and Spring developers who were interested in Spring certification earlier but couldn't progress further due to expensive mandatory training. Since many of them are now preparing for Spring certifications like Spring Core  or Spring Professional (VMware EDU-1202) via self-study they are increasingly looking for good resources to prepare for the exam. I have received a lot of questions on preparation, books, mock exams, exam structure, passing marks, and useful resources.

Tuesday, April 1, 2025

Top 10 Advanced C++ (CPP) Books for Experienced Developers - Must Read

Once you know C++ and spends a couple of years of programming in C++, you started to feel that you know the basics and have good command over C++ programming. At this time, the programmer goes to two paths, one who chose to do just fire-fighting and daily work and never upgraded or forced to learn new or more by reading books, participating in forums, and giving presentations. The other group of programmers explores new books to learn C++ in detail and after reading a couple of books on this list, they also realize how much of C++ they know is incomplete and incorrect. That's why I recommend experienced C++ developers to read books to complete the journey from a junior developer to a senior developer.

Top 3 Books to Learn TCP/IP, UDP and Computer Networking Protocols - Best of Lot

Both TCP/IP and UDP are very popular networking protocol and in this era of the internet and a connected world, they become even more important. No matter, whether you are a computer science graduate or doing masters in computer science, a software engineer, a network engineer, or a Java programmer, good knowledge of TCP/IP and UDP goes a long way to securing a job and doing well on it. Even though I mostly interview for Java programmers, I almost always ask a couple of questions on TCP/IP and UDP protocol to check if the candidate is familiar with computer network basics or not because even if you work for Java application, you are exposed to the network.

Top 5 jQuery books for Beginners and Web developers - Best of lot

jQuery is an open-source JavaScript library, which has completely changed the way, client-side web development was done using HTML, CSS, and JavaScript. With the growing popularity of jQuery, it becomes imperative for web developers to learn and take advantage of jQuery, and books are one of the best ways to learn jQuery. In this article, I am going to share your top 5 jQuery books from my personal collection, which I have looked at and researched before purchasing my first book on jQuery, Head First JQuery. Since I like to follow one book at a time, I didn't bother to look into another must-read book, JQuery in Action, until I have finished formerly.

Top 5 Soft Skill and Career Development Books and Courses for Programmers

Most of the software developers, programmers, and coders spend a considerable amount of their time and energy on learning technologies which get obsolete in few years like a new framework or a new programming language but they neglect something more important like soft skills. Unlike technical stuff, soft skills will not only serve you good in your job and career but also in your life and it won't get obsolete as quickly as the new web application development framework you have just learned. Similarly, most of us put a lot of effort to get a job but after that, we don't put much effort to grow on that job, the result is many programmers and software developers stuck in their careers.

Top 10 Advanced Java books for Intermediate and Experienced Developers

Hello guys, once you learn Java and done with reading some of the best known introductory books on Java and have a couple of years of experience under your belt, you would be hungry to transition from an intermediate Java developer to an expert Java programmer, also known as Java guru. This transition is not smooth, and I have seen many Java developers having 2 to 6 years of experience stuck where they are and have absolutely no knowledge of advanced topics like JVM internals, Concurrency, Garbage collection, and Performance tuning.

Top 5 Books to learn UML (Unified Modeling Language) for Java Developers - Best of Lot, Must Read

The UML stands for Unified Modelling language and it is one of the great tools for Object-oriented design. It allows you to create several diagrams like class diagram, sequence diagram, object diagram, etc, which helps you to understand your system better.  The UML also helps you to convey your thoughts and design to peers and team members before implementation. Since a picture is worth a thousand words, those interactions often help you to find shortcomings and loopholes in your software design very early. That's actually the reason I use UML in our projects. Btw, I didn't know about UML or UML diagrams when I first started Java development.

Top 5 FREE eBooks to Learn jQuery Online or download PDF

Hello guys, Everybody loves free resources, don't you? Well, I do and that's why I am always in search of good free resources like eBooks and training courses. In the last article, I have shared some of the free JavaScript books and this time I am sharing a couple of good free eBooks to learn jQuery. JQuery is one of the most important skills in today's internet world. It is the JavaScript library that has changed the face of websites, they are now more interactive and smooth than ever before. The Internet is also not short of free resources and when it comes to learning jQuery, you will find thousands of articles and tens of eBooks, but not all resources are good. Some of them are not up-to-date and many of them contain incorrect information, hence choosing a good resource is vital.

Monday, March 31, 2025

Which Programming Books Would You Buy If you got 100$ to Spend?

Hello Guys, it's time to take a hypothetical question in Javarevisited. I love books and I have so many in my library and on my phone but this time, I am asking for your recommendations. Which programming book, would you love to buy, if you are given 100$ to spend? I know, when it comes to buying, people want the worth of their money, and that's why I am posting this question to you guys. Suppose you are looking for some books in a bookstore and suddenly salesman comes and say, at this particular minute, we are giving you 100$ FREE to buy any programming book.

Sunday, March 30, 2025

3 Books to Learn Eclipse IDE for Java JEE Programmers - Best of Lot

In order to become a good Java developer solid knowledge of Eclipse IDE, or whatever IDE you use, like Netbeans or IntelliJIDea, is a must. Java has been blessed with excellent tooling which turbo-charge application development. IDEs or Integrated Development Environment allows you to code, run, test, and debug from just one tool. They are an immense productivity booster. Since I have started Java development coding in Notepad, TextPad, and JCreator, I know how it feels to have the power of IDEs with you. There are three big IDEs in Java world, Eclipse, NetBeans and IntelliJIDEA. The first two are free, and the third one requires the license. I use Eclipse, and it's also the most popular IDE in Java world.

Top 2 Books for OCPJP8 Certification - Java 8 1Z0-809, 810, 813 Exam

This is the second part of the best books for Java 8 certifications. Since you need to pass two exams, OCAJP8 and OCPJP8, to become a Java SE 8 certified developer, I have shared some of the best OCAJP8 books in the last article. In this article, I will tell you more about the second exam, OCPJP8, and suggest the best books to prepare OCPJP8. This exam is known as a professional level exam, and it's more stringent than the associate level exam. The OCPJP8 stands for Oracle Certified Professional Java Programmer. The exam code for this certification is 1Z0-809. While there are many latest Java certification available now like OCPJP 21, OCPJP 17, or OCAJP 11, Java 8 certification is still the easiest certification you can to become a certified Java developer.

Top 5 Java And Android Game Programming Books for Programmers

Many programmers and game developers think that Java isn't the best language for game design, but you cannot ignore Java for game development. There is always some popular platform that allowed you to develop and sell games in Java, like J2ME in past and Android now. Ever since Android used Java as a programming language, the game development in Java has got a new lifeline and seems to be doing quite well. Even games like Minecraft also doing great on the Java platform. It's true that C++ is still the best language to develop games due to its high-performance and many top game development companies like Sony, Nintendo, and Microsoft Xbox prefer C++ over Java when it comes to developing great games. But with the introduction of Android and iOS has completely changed the game development industry.

Top 5 Free Scala Programming Books for Java Programmers, Download as PDF or Read Online

Scala is another JVM based programming language, which is quickly gaining popularity because of its exciting mix of object-oriented and functional programming paradigm. Many companies have started using Scala for there strategic and mission-critical development. One of the best known is Twitter, which is also one of the key factors in the growing popularity of the Scala programming language. If you are a Java, C++ or C# programmer, who is willing to learn Scala in your spare time, then you will be surprised to see how much helpful content is available for FREE on the internet. By the way, Java 8 is not far away, the only couple of months to go, and there are already some decent tutorials available online. If you are learning Java 8, you may like to see my list of resources on Java 8 as well.

How to Enroll on Spring Professional Certification (VMware EDU-1202) and Schedule Exam

So, you have been preparing for Spring certification for quite a sometime, and now you feel you are ready to take the exam, and it's time to buy the Spring certification voucher and schedule your exam. In this article, I'll show you how to buy the Spring certification voucher online. But, before purchasing a voucher, I would like to remind you that the Spring certification (VMware EDU-1202) voucher is only valid for 90 days, after that it will expire. So, it's best to buy the voucher only if you are ready for the exam i.e. you have gone through several Spring Mock tests and practice tests given in Spring study guides and you are consistently scoring over 80% on them.

Why become a Certified Java Programmer? Does Oracle Certified Professional Earn more?

I have seen many Java programmers in doubt whether to go for Java certifications or not? Whether getting Java certified will help them to earn a better salary? or after becoming Java certified from Oracle will help them to get a Job. In this article, we will see what the benefits of getting Java certified are. I know higher income, better job prospects, and a better chance of promotion is at the top of the benefits of becoming a certified Java professional, but this certification provides much more value than that. Apart from all those tangible benefits, the most important thing is that you learn Java better, which help you everywhere like in your day job as well as on interviews.

How to share your Programming Articles on Javarevisited for more Exposure

Hello, Friends,
I have been writing Java articles for a long time and one thing I have learned from that experience is that learning makes you a better Programmer and Software developer. It's also one of the important tips I have shared on how to become a better programmer article long back. It seems many people like that and contacted me about that but their main difficulty was that after writing one or two articles they get frustrated because no one was reading it. Well, I can understand but it takes a lot of time and effort to build a following. I am fortunate and really grateful that Java community has given me so much love and that's why I have decided to do my bit to promote and encourage every new Java programmer/writer/blogger to the best I can.

How I lost 10 Kg weight by Buying A Digital Weight Machine and Checking Weight Daily

You must be wondering why I am sharing a weight loss or physical fitness tip in my Java programming blog? Well, after reading Soft Skills: The software developer's life manual by John Sonmez, a software developer, and life coach, I found that fitness is very important for programmers and it's about time we should take it seriously.  In general, programmers and IT professionals are not the most physically active persons and hence the easy target for the life-threating disease like heart-attack and diabetic. I started my weight loss journey last year, achieved something but lost it again due to busy work schedule. In this article, I am going to share some of my experience, starting with the most simple trick to lose weight, which worked for me and helped me to lose 8Kg in 3 months.

Monday, March 24, 2025

How to sort array in decreasing order in Java? Example Tutorial

It's easy to sort an array on increasing order by using Arrays.sort() method, which by default sort the array on increasing order, but if you have to sort array into decreasing order then how do you it? For example, if you have an array of Strings {"a", "b", "c"} how do you sort them into descending order? Well, if you remember, Arrays.sort() is overloaded and there is another version, which accepts a Comparator. To sort the array in decreasing order, you can simply providing a comparator which compares element in the reverse order. Thankfully there is one such Comparator already exists in JDK API, Collections.reverseOrder()

Sunday, March 23, 2025

FIX Session is not connecting how to diagnose it? Example Tutorial

In this blog post of the FIX protocol tutorial series I would like to share my experience with connectivity issues around Fix Engines. to exchange messages or say to trade electronically clients connect to the broker using FIX protocol and for that, they use FIX Engine. In FIX protocol connection between two FIX Engines is refereed as FIX Session and we normally say whether FIX Session is connected or not connected. FIX Session normally has their start time, end time, and EOD time (End of day time) also called TradingSession start time, Trading Session End Time, and Trading Session EOD time.

Friday, March 21, 2025

How to Fix java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test [Solved]

The error "java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test" occurs when you try to connect MySQL database running on your localhost, listening on port 3306 port from Java program but either you don't have MySQL JDBC driver in your classpath or driver is not registered before calling the getConnection() method. Since JDBC API is part of JDK itself, when you write a Java program to connect any database like MySQL, SQL Server, or Oracle, everything compiles fine, as you only use classes from JDK but at runtime, when the JDBC driver which is required to connect to the database is not available, JDBC API either throws this error or "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver".

Wednesday, March 19, 2025

How to Fix Failed to connect to queue manager - WebSphere MQ Error in Java? Example

"Failed to connect to queue manager" error comes in WebSphere MQ if any Client like a Java program is not able to connect to the MQ server due to any reason. The reason is actually identified by reason code in error message e.g. code 2397 comes when SSL is enabled between client and server and Java client is not able to connect to the server due to unknown or expired SSL certificates. If you are working in a Java application that is using WebSphere MQ for messaging over SSL then you are bound to face some setup, certificate, and keystore vs truststore related error. 
Page 1 of 2971234567...297Next »Last