C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Javascript »

Introduction about JScript .NET


Posted Date: 03 Jan 2009    Resource Type: Code Snippets    Category: Javascript
Author: Nikhil AgarwalMember Level: Gold    
Rating: 1 out of 5Points: 12



Introduction about JScript .NET
JScript .NET is the single most significant upgrade to It is a flexible and powerful programming that you can use to create everything from simple scripts to full-blown Windows or Web-based applications. JScript .NET have maintained 100% backwards compatibility with existing JScript code.
It is fully object-oriented programming language, support for classes, inheritance, polymorphism, function overloading, and many other OO features. JScript .NET maintains its easy to use nature by allowing you to take advantage of new language features as you become familiar with them. For example, even though JScript .NET supports typed variables, you're still free to not even declare variables before using them. JScript .NET is the only other standardized language currently available on the .NET Platform (C++ is the other standardized language) - standardization is your assurance of on-going multi-vendor support for JScript .NET.
The following listing demonstrates some of JScript .NET's new features:

// create a new package (namespace)
package myjsnetSample {

// declare a new class
class myjsnetClass
{
// static member variable - a variable that can exist without a class
public static var staticString : String;

// Note the staticString declaration above - it is a String variable

// Sample member function - takes a string argument and return an int
// The declaration of the function's parameter type is similar to
// declaring a variable...
public function testMethodOne(param1 : String) : int {

// declare a variable and initialize it
var i : int = 5;
// call a .NET Class Library method to send output to the console
Console.WriteLine("Hello {0}\n",param1);
return i;
}

// overload methodOne for to take int parameter and
// return a String (reverse of original method)...
public function testMethodA(param1 : int) : String {
//...
return "this is a string";
}

// declare a private member function
// Private member functions are accessible only by the
// class that declares the function...
private function privateMethod() {
//...
}
// Static initializer - initialies static variables even
// without an instance of the class avaialble at runtime...
static {
sampleString = "This is a static initializer";
}
} // end of the class
} // end of the package

The listing demonstrates the following features:
• The package statement to create a new namespace
• The class statement
• Typed and static variables
• Member functions
• Function overloading
• Working with the .NET Class Library




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Introduction about JScript .NET  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Clear web control value in one button click Using Javascript
Previous Resource: Javascript with Regular Expression
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use