Post reply

The message has the following error or errors that must be corrected before continuing:
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Note: this post will not display until it has been approved by a moderator.
Attachments: (Clear attachments)
Restrictions: 20 per post (20 remaining), maximum total size 24.00 MB, maximum individual size 24.00 MB
Uncheck the attachments you no longer want attached
Click or drag files here to attach them.
Other options
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S post or ALT+P preview

Topic summary

Posted by sukishan
 - Sep 04, 2009, 03:51 PM
Variables and Constants
Constants in J# are prefixed by the final keyword. All the other mechanisms of creating new value types and reference types are similar to those of C#.

package hks;
import System.*;
public class UseVariables
{
  public static void main()
  {
    final String HELLO_WORLD = "Hello World";
    String message = HELLO_WORLD + " in VJ#";
    MyClass mc = new MyClass(message);
    mc.Print();
  }
}
public class MyClass
{
  private String message;
  public MyClass(String message)
  {
    this.message = message;
  }
  public void Print()
  {
    Console.WriteLine(message);
  }
}