I was crushing the code above Until I did not realized that both lat and lon are the radian Value!
You have to convert them back to the degrees, and you will see real values.
Here is the code
public class cal
{
public static void main(String []args){
double R = 6371.0;
double d = 0.100;
double lat1 = 42.873, lon1 = 74.568;
double Radlat1 = Math.toRadians(42.873);
double Radlon1 = Math.toRadians(74.568);
double brng = Math.toRadians(225);
double lat2,lon2;
System.out.println("Hello World");
//lat2 = Math.sin();
lat2 = Math.asin(Math.sin(Radlat1)*Math.cos(d/R) +
Math.cos(Radlat1)*Math.sin(d/R)*Math.cos(brng));
System.out.println("Lat2degree"+"="+Math.toDegrees(lat2)+"\n"+"Lat2="+lat2);
double NewRadLat2 = Math.toRadians(Math.toDegrees(lat2));
lon2 = Radlon1+Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(Radlat1),
Math.cos(d/R)-Math.sin(Radlat1)*Math.sin(lat2));
System.out.println("Lon2"+"="+Math.toDegrees(lon2));
}
}