TAILIEUCHUNG - HandBooks Professional Java-C-Scrip-SQL part 226

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 226', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Ruby in a Nutshell By Yukihiro Matsumoto Chapter 2. Language Basics Variables There are five types of variables in Ruby global instance class locals and constants. As you might expect global variables are accessible globally to the program instance variables belong to an object class variables to a class and constants are well. constant. Ruby uses special characters to differentiate between the different kinds of variables. At a glance you can tell what kind of variable is being used. Global Variables foo Global variables begin with . Uninitialized global variables have the value nil and produce warnings with the -w option . Some global variables have special behavior. See Chapter 3. Instance Variables @foo Instance variables begin with @. Uninitialized instance variables have the value nil and produce warnings with the -w option . Class Variables @@foo Class variables begin with @ @ and must be initialized before they can be used in method definitions. Referencing an uninitialized class variable produces an error. Class variables are shared among descendants of the class or module in which the class variables are defined. Overriding class variables produce warnings with the -w option. Local Variables foo Local variables begin with a lowercase letter or _. The scope of a local variable ranges from class module def or do to the corresponding end or from a block s opening brace to its close brace . The scope introduced by a block allows it to reference local variables outside the block but scopes introduced by others don t. When an uninitialized local variable is referenced it is interpreted as a call to a method that has no arguments. Constants Foo Constants begin with an uppercase letter. Constants defined within a class or module can be accessed from within that class or module and those defined outside a class or module can be accessed globally. Constants may not be defined within methods. Referencing an uninitialized constant produces an error. Making an .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.