*Hello Elias,*

*Following is my java file: *


package reversebinding;

public class RBinding {
 public static String getStringFromJava() {
        return "Hello from java !!";
    }
}




*I tried the following in my go file : *



import "Java/reversebinding/RBinding"


// creating object like this: 

javaObj := JavaAPI.New()
javaObj.GetStringFromJava()

*But while building using the gomobile it is giving following error: *
JavaObj.GetStringFromJava undefined (type Java.Reversebinding_JavaAPI has 
no field or method GetStringFromJava)
undefined: val


*If I call using class name: it is working fine. but with object it is not 
working.*


*Can  you please provide your suggestion ? *

*Thanks.*


On Thursday, September 12, 2019 at 1:14:21 PM UTC+5:30, Jay Sharma wrote:
>
> Hello Elias,
>
> Following are the lines from proposals:
> Creating new Java instances 
>
> To create a new instance of a Java class, use the New function defined in 
> the class package. For example:
>
> import ( 
> "Java/java/lang/Object" "Java/java/lang"
> ) 
>
> func NewObject() lang.Object { 
>     return Object.New() 
> }
>
> *How can I modify it for my class ? *
>
> I know, It is too much to ask. I got confused. 
>
> *Thanks for your help.*
>
>  
>
>
> On Wednesday, September 11, 2019 at 9:41:13 PM UTC+5:30, Elias Naur wrote:
>>
>> On Wed Sep 11, 2019 at 7:20 AM Jay Sharma wrote: 
>> > 
>> > 
>> > *Now, I want to create object of this class in go and want to call 
>> method 
>> > using that object from go. * 
>> > 
>> > I was checking your proposal (https://github.com/golang/go/issues/16876) 
>>
>> > but could not able to make it. :( 
>>
>> The proposal suggests calling the generated New method on the object. 
>> Did you try that? If so, what went wrong? 
>>
>> -- elias 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/36a1de11-0a4b-478c-94b2-a01d8f2f4fc4%40googlegroups.com.

Reply via email to