int x; String s; String s1, s2; Object o; Object obj = new Object(); public String name; Dim x As Integer Dim s As String Dim s1, s2 As String Dim o 'Implicitly Object Dim obj As New Object() Public name As String var x : int; var s : String; var s1 : String, s2 : String; var o; var obj : Object = new Object(); var name : String; |
Respon.Write("foo"); Respon.Write("foo") Respon.Write("foo"); |
john snow// This is a comment /* This is a multiline comment */ ' This is a comment ' This ' is ' a ' multiline ' comment // This is a comment /* This is a multiline comment */ |
String s = Request.QueryString["Name"]; String value = Request.Cookies["key"]; Dim s, value As String s = Request.QueryString("Name") value = Request.Cookies("Key").Value 'Note that default non-indexed properties 'must be explicitly named in VB var s : String = Request.QueryString("Name"); var value : String = Request.Cookies("key"); |
// Default Indexed Property public String this[String name] { get { return (String) lookuptable[name]; } } ' Default Indexed Property Public Default ReadOnly Property DefaultProperty(Name As String) As String Get Return CStr(lookuptable(Name)) End Get End Property //JScript does not support the creation of indexed //or default indexed properties. However, specifying the //expando attribute on a class automatically provides //a default indexed property who type is Object and //who index type is String. //To emulate the properties in JScript, u function //declarations instead. public function Item(name:String) : String { return String(lookuptable(name)); } |
public String name { get { ... return ...; } t { ... = value; } } Public Property Name As String Get ... Return ... End Get Set ... = Value End Set End Property function get name() : String { ... return ...; } function t name(value : String) { ... = value; } |
// Declare the Enumeration public enum MessageSize { Small = 0, Medium = 1, Large = 2 } // Create a Field or Property public MessageSize msgsize; // Assign to the property using the Enumeration values msgsize = Small; ' Declare the Enumeration Public Enum MessageSize Small = 0 Medium = 1 Large = 2 End Enum ' Create a Field or Property Public MsgSize As MessageSize ' Assign to the property using the Enumeration values MsgSize = small // Declare the Enumeration mandatoryenum MessageSize { Small = 0, Medium = 1, Large = 2 } // Create a Field or Property var msgsize:MessageSize // Assign to the property using the Enumeration values msgsize = MessageSize.Small |
foreach ( String s in coll ) { ... } Dim S As String For Each S In Coll ... struckNext for (var s : String in coll) { ... } |
// Declare a void return function void voidfunction() { ... } 专业在线翻译// Declare a function that returns a value String stringfunction() { ... return (String) val; } // Declare a function that takes and returns values String parmfunction(String a, String b) { ... return (String) (a + b); } // U the Functions voidfunction(); String s1 = stringfunction(); String s2 = parmfunction("Hello", "World!"); ' Declare a void return function Sub VoidFunction() ... End Sub ' Declare a function that returns a value Function StringFunction() As String ... Return CStr(val) End Function ' Declare a function that takes and returns values Function ParmFunction(a As String, b As String) As String ... Return CStr(A & B) End Function 江南style歌词什么意思' U the Functions VoidFunction() Dim s1 As String = StringFunction() Dim s2 As String = ParmFunction("Hello", "World!") // Declare a void return function function voidfunction() : void { ... } // Declare a function that returns a value function stringfunction() : String { ... return String(val); } // Declare a function that takes and returns values function parmfunction(a:String, b:String) : String { ... return String(a + b); }instantly // U the Functions voidfunction(); var s1:String = stringfunction(); var s2:String = parmfunction("Hello", "World!"); |
本文发布于:2023-06-18 09:10:44,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/fan/90/149194.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |