Skip to main content

Posts

Showing posts from October, 2016

Most Common mistakes in Java Coding.

1. Copy & Paste

Its one of the most powerful tool and technique in the typical programmer. But at the same time its too dangerous that you ought to forgot the code according to you requirements. So always be cautious about what piece of code you are copying. Read at least two to three times to avoid the tricky for fishy things while your unit testing.

2. Exception Catch Block.

Always give priority to write some thing useful and meaning full statements in the exception catch block.It really worth when you troubling shooting the issues. Never leave this block with empty or sop's. And always throw the exception to the calling method.

3. String operations

Since String is immutable object, when you do any operation on string that results a new object. So after you do any modifications on String and do assign the string some object and use it.

4. Null pointers

Don't perform the operations on objects without checking the Object null condition. And while checking the null condition alw…

CRON Expressions

CRON expression.Cron-Expressions are used to configure instances of CronTrigger. Cron-Expressions are strings that are actually made up of seven sub-expressions, that describe individual details of the schedule. These sub-expression are separated with white-space, and represent:

SecondsMinutesHoursDay-of-MonthMonthDay-of-WeekYear (optional field)+-------------------- second (0-59)|+----------------- minute (0-59)||+-------------- hour (0-23)|||+----------- day of month (1-31)||||+-------- month (1-12)|||||+----- day of week (0-6)(Sunday=0 or 7)||||||+-- year [optional]|||||||******* command to be executed Examples.1. For every 10 seconds 0/10 * * 1/1 * ?2. For every Sunday midnight at 23:00 0 0 23 ? * SUNSome of the frequently used schedulesYou can play with http://www.cronmaker.com/ website for more number of combinations. Cron Expression ExamplesCron Expre