Adam, thanks you for the answer.
However, I'm not sure if that's answering my question.
I know how to create the world file. The thing is, I have a BufferedImage which is created inside my java code, then I save/write this image on my computer. Meanwhile, Knowing the east/north scales of the image and easting/northing coordinates of its top-right corner, I create its world file by the below code:
PrintWriter writer = new PrintWriter("D:\\imageName.tfw", "UTF-8");
writer.println(NorthScale);
writer.println(0.0);
writer.println(0.0);
writer.println(EastScale);
writer.println(Easting);
writer.println(Northing);
writer.close();
This correctly creates a world file in the same location/name as my saved image. Now, if I want to load this image as raster data on the right location on my base map inside my java code, I need to add its spatial reference (e.x., "WGS_1984_UTM_Zone_8N") so it can be displayed in the right location.
In ArcMap, this could be done by right click on the image in the Catalog and then click on Properties and finally editing the Spatial Reference inside "Raster Dataset Properties" window. But I need to do this in java and using java code and my question is how I should do this inside my Arc GIS Runtime java code!
Thanks,
Mohammad