is there any java function can I use to get value of the period (month & year)
if period - 1 then it should be last month
if period + 1 then it should be next month
it also must be considered if currently in january.. then if period - 1 it should be december last year ..
and also if it's on december then if period + 1 then it should be next year.
any idea or java function can I use for doing this?
Java doesn't have functions. You're probably looking for a class.
Look at the Calendar class and its relatives for working with dates.