Send message from Java to C#

Hi There,

I'm trying to send a message from Java to C#, but I cant get the right coding for C#.

In JavaScript I do:

function BlastCollided () {
beam.SendMessage ("DoExplode");
}

How do I call the "DoExplode" in C#?

I need to tell the script to

Explode();

I tried this example from Unity Scripting reference, but got the following errors:

A get or set accessor expected

`Detonator.DoExplode': property or indexer cannot have void type

Anyone care to sooth this pain of mine?

EDIT: If for example I want to destroy my object when the receivers gets the message in Java, I would have done the following:

To send the message from object A:

    if input.GetButtonUp("Fire1") {
  ObjectB.sendmessage("DoExplode");

}

To Receive the message from Object A and do something

function DoExplode {
 MyObject.Destroy();

}

But now, I want to do exactly the same, but only in C#

// In C#

void BlastCollided () {
    beam.SendMessage ("DoExplode");
}

// Full C# Example script:

using UnityEngine;
class Example : MonoBehaviour {
    public GameObject beam; // Or public Component beam;, or what type you have
    void BlastCollided () {
        if (!beam) print("You have forgot to set 'beam' variable");

        beam.SendMessage ("DoExplode");
    }
}

I'm trying to do the oposite thing - to send message from C# to Js. I have Player with javascript, which opens door in game with raycast, when player meets enemy, raycast lenght is set to 0, when he kills enemy, my enemy's C# script would destroy enemy gameObject and set players raycast back to 5. That would be a simple function in player's script :

function EnableRay () {
 rayCastLength += 5; 
}

My enemy script looks like this :

using UnityEngine;
using System.Collections;

public class NewRobotLives : MonoBehaviour
{
    //Fields
    public int lives = 3;
    public ParticleEmitter blood;

    //Trigger Function
    void OnTriggerEnter(Collider col)
    {
        if (col.tag == "bullet")
        {
            Debug.Log("Collision with bullet detected");

            //Decrease Life and destroy bullet
            lives -= 1;
            Destroy(col.gameObject);
        }

        //Check if we destroy our enemy
        if (DidEnemyDie())  {     
            Destroy(gameObject);
            Instantiate (blood, transform.position, transform.rotation);
            iTweenEvent.GetEvent(GameObject.FindWithTag("PlayerTag"), "Shake").Play();

         // here I should call EnableRay( )  in player' s script

        }

    }

    //Function return true if life < 0
    bool DidEnemyDie()
    {
        return lives <= 0 ? true : false;
    }

}