Log4j

The following blog is a simple insight into a very helpful and widely used framework for logging purpose. Bingo !!! You are right – Log4j Log4j is designed to be highly configurable using simple configuration files at runtime. Using its main components viz. Loggers,appenders and layouts it provides a very extensive logging process in quiet many …

More

Debugging tests cases with maven : java remote debugging

The project testcases can be debugged in maven by the java remote dubugging options. Just add the debugging options along with the mvn test command. $ mvn test now becomes: mvn -Dmaven.surefire.debug=”-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE” test The ‘suspend=y’ flag will pause the execution until you have attached a debug port for listening. Thats it, just …

More

Immutability

The most common question you ever come round with in Java is : “Why is String class called Immutable ?”  ( No Offence Intended !!! ) Hold on… we are not going to answer this here, this is the first thing you are taught or you learn when encountering String for the first time. We …

More

ConfusedCoders Java Interview preparation ebook

This is a collection of few interesting java interview questions that interviews love to ask. Feel free to download and share the book. Download from Slideshare:  http://www.slideshare.net/venomPill/the-java-interview-questions-ebook-confused-coders-14116499 Yash SharmaYash Sharma is a Big Data & Machine Learning Engineer, A newbie OpenSource contributor, Plays guitar and enjoys teaching as part time hobby. Talk to Yash about …

More

Longest Subsequence palindrome java implementation

package com.test.dev; public class LongestSubSequencePalindrome { /** * @param args */ public static void main(String[] args) { String str = “tatestseatat”; // Any test String char modChars[] = str.toCharArray(); int length = modChars.length; int maxSubSeqLen = getMaxSubSeq(modChars,0,length-1); System.out.println((maxSubSeqLen)); } private static int getMaxSubSeq(char[] modChars,int j, int i) { if(i-j <= 1 || (i-j == 2 …

More