Browsed by
Category: Java

Singly Linked List Algorithm Implementation Java Example

Singly Linked List Algorithm Implementation Java Example

Linked list is nothing but having the link of the next node with the current node, this gives lot of advantages like directly doing any manipulation on particular node instead of iterating everything for all the operations like we do in arraylist.   Why we need Linked List ?   Array does not help us for these things, so forced to go for linked list.   1. No dynamic size: All the time we can’t mention the correct required size,…

Read More Read More

645 total views, no views today

Reversing a string using Stack Implementation

Reversing a string using Stack Implementation

In our previous post, we saw how to create a custom stack implementation in java.¬†Today we are going to extend the same implementation to perform additional operations like reversing, checking empty or full etc. Approach 1: [Simple & Best Approach]   We have used the same Stack class from this post [Java Stack Implementation Simple Example]¬†with small modification like array type changed from int to char.   Modified Stack Class: [Stack.java] package in.javadomain; public class Stack { char item[]; int…

Read More Read More

564 total views, no views today

Java Stack Implementation Simple Example

Java Stack Implementation Simple Example

Recently I started refreshing the backbone of CS, data structure and algorithms. As part of that I wrote a core stack implementation functionalities like Push and Pop in java. I also wrote isEmpty() method just to make use in loops and stuffs like that.   I want you to try writing the stack(LIFO – Last In First Out behaviour) implementation program yourself with these key points, Create a class named Stack Have an array to push and pop (store and…

Read More Read More

561 total views, no views today

Auto Expand Column/Cell Excel Writing in Java

Auto Expand Column/Cell Excel Writing in Java

Auto Expand Column/Cell Excel Writing in Java: When you are writing an excel sheet through java program you will come to these kind of requirements. By default excel file will be generated without any auto fit to text or auto column width properties. We need to set the sheet and cell styles/properties for this externally.   Prerequisite: You need all Apache Poi Jars to write the excel sheet through Java (Refer below post for all the jars) I used pojo…

Read More Read More

829 total views, no views today

Google Webmaster Console Keyword Position Report Program in Java

Google Webmaster Console Keyword Position Report Program in Java

Google Webmaster Console Keyword Position Report Program in Java: This post will be very helpful for one who has website and already configured in google webmaster console. Google webmaster console is a place whee you can add your sites sitemap and check the keyword position, total impressions and clicks of each keyword details.   This java program will compare current month and previous month google webmaster console report and give you Keywords which started appearing newly Keywords which stopped appearing…

Read More Read More

1,040 total views, no views today

3 Simple Steps to Install Certificate in Java

3 Simple Steps to Install Certificate in Java

3 Simple Steps to Install Certificate in Java In java all the certificates should be installed in the below file: C:\Program Files\Java\jre1.8.0_111\lib\security\cacerts Path and version vary based on your own system configuration, path where you installed and version what you installed. You can find a file named “cacerts” which is the one will have all the certificate details installed on this particular jre. Step 1: Path of the certificate storage As I mentioned lib\security\cacerts is the path where we need…

Read More Read More

612 total views, no views today

How to connect to CPanel Remote MySql in Java ?

How to connect to CPanel Remote MySql in Java ?

How to connect to CPanel Remote MySql in Java ? When you are having your code in local and you want to connect your remote mysql which is in your cpanel, then you need to follow below steps to connect to it.   Step 1: Login to CPanel and Navigate to Remote MySql   Login to cpanel and navigate to remote mysql which is under databases CPanel Login -> Databases -> Remote MySql -> Click     Step 2: Find…

Read More Read More

850 total views, no views today

Remove all special characters except percentage (real time use case)?

Remove all special characters except percentage (real time use case)?

How to remove all special characters except percentage (real time use case)? If you are running a coupon website, then you will have this issue sometime while parsing/scrapping coupons from merchants.   For example, you will have these three types of strings: 1. Get 10% Cashback 2. Get Rs. 10/- Cashback 3. Get 10/- Cashback 4. Get (Indian rupee symbol) 10 Cashback If you use the below regex pattern then it will remove all the special characters: [ ](?=[ ])|[^-_,A-Za-z0-9]+…

Read More Read More

573 total views, no views today

Reading JSON Response From URL in Java

Reading JSON Response From URL in Java

Reading JSON Response From URL in Java: As we know, JSON is becoming one of the famous and easily usable file type mainly due to its light weight. Before JSON, XML was preferred to transfer the data from one to another place. So being java developer it’s very mandatory to know how to read JSON files. In this post I am covering how to read the JSON responses directly from URL (similar to web services) and also covered 3 different…

Read More Read More

822 total views, no views today

Reading Empty / Blank Cell in Excel using Java

Reading Empty / Blank Cell in Excel using Java

Reading Empty / Blank Cell in Excel using Java: Somedays back I published how to read excel file in java, but one of the user reported me that it is not working as expected when it come across the empty/blank cell(s) in the excel sheet. So I rewritten the excel reading program in java (which also reads or handles empty/blank cell properly) after going through the apache poi documentation for these scenario. Full reading empty / blank cell in excel…

Read More Read More

583 total views, no views today