# NOT RUN {
s <- .jnew("java/lang/String", "foo")
.jequals(s, "foo") # TRUE
.jequals(s, "foo", strict=TRUE) # FALSE - "foo" is not a Java object
t <- s
.jequals(s, t, strict=TRUE) # TRUE
s=="foo" # TRUE
# }
# NOT RUN {
Double <- J("java.lang.Double")
d1 <- new( Double, 0.0 )
d2 <- new( Double, 1.0 )
d3 <- new( Double, 0.0 )
d1 < d2
d1 <= d3
d1 >= d3
d1 > d2
# cannot compare a Double and a String
try( d1 < "foo" )
# but can compare a Double and an Integer
d1 < 10L
# }
# NOT RUN {
# }
Run the code above in your browser using DataCamp Workspace