Hi Ramya,
If you would like to include complete java code into test step, you can use "Execute script" step or "JavaScript step" in test case. Make sure you have copied external jar files to <Devtest_home>/hotdeploy folder.
If your requirement is to read and write data from Excel file, you can use Dataset to read data from excel and "Save property value to file" filter to save data to excel.
Thanks & Regards
Srikanth Gajawada