...

these two classes combined .try this.you can get answer.The main method you can implement as you want.
Thank you!!