Original Answer based on initial question:
Your syntax is not javascript. Here is what the JS would look like:
var myObject = {
myProperty: 'value',
anotherProperty: 'some other value'
};
function func(obj) {
var thisProperty = obj.myProperty;
}
Well... the tags were changed to Java... so the answer also changes...
Your property variable is a double value which does not have a "prop" property.
Let's say you have an Object like so:
public class MyObject {
private double prop;
public double getProp() { return this.prop; }
}
Instantiate an instance of MyObject
MyObject myObj = new MyObject();
myObj.setProp(13.2);
The method could look something like this (inside a class for this example):
public class MyService {
private double property;
public void func(Object obj) {
if (obj!=null) {
this.property = obj.getProp();
}
}
}
Pass the instance to the method:
MyService.func(myObj);