From Java to C#: A Developer's Guide

Heng Ngee Mok

  • 出版商: Addison Wesley
  • 出版日期: 2003-01-17
  • 售價: $1,580
  • 貴賓價: 9.8$1,548
  • 語言: 英文
  • 頁數: 464
  • 裝訂: Paperback
  • ISBN: 0321136225
  • ISBN-13: 9780321136220
  • 相關分類: C#Java 程式語言
  • 下單後立即進貨 (約5~7天)

買這商品的人也買了...

相關主題

商品描述

Table of Contents:

About the Author.
Preface.
Introduction.

Acknowledgments.

I. INTRODUCING .NET AND C#.

1. Introducing .NET.

Evolution: from COM to .NET.

What exactly is .NET?

Multiple .NET programming languages and VS .NET.

Intermediate language.

The .NET common language runtime.

Competing in parallel with Java technologies.

Common language infrastructure.

Other .NET-related technologies.

Unsafe codes and real time programs.

Porting .NET to other operating systems.

2. Introducing C#.

Potent combo of Java and C!!

3. JUMP to .NET and J#.

Java Language Conversion Assistant.

The J# language.

4. Hello C#!

How to compile and run the code examples in this book.

Some .NET specifics.

Disassembling an assembly file.

II. CLASSES, METHODS, AND OTHER OO STUFF.

5. Getting started.

Basic class structure.

Basic console I/O.

C# namespaces (Java packages).

6. Class issues.

Class modifiers.

Class members.

Creating an object with the new operator.

Looking at System.Object.

Class inheritance.

Implementing interfaces.

Sealed classes (Java final classes).

Abstract classes.

Nested classes (Java inner classes).

7. Method issues.

Method modifiers.

Method basics.

Instance constructors.

Static constructors (Java static initializers).

Destructors.

Constructor initializers and constructor chaining.

Method overloading.

Passing variable numbers of parameters into C# methods.

Abstract methods.

Method overriding using the virtual and override modifiers.

Method hiding with the new keyword.

Static methods.

Sealed methods (Java final methods).

8. Miscellaneous issues.

Access modifiers.

Static members.

C# constants and read-only fields (Java final variables).

Volatile fields.

III. TYPES, OPERATORS, AND FLOW CONTROL.

9. C# types.

Pointer types.

Reference types.

Value types.

Unsigned types in C#.

The decimal type.

The char type.

The string type and string literals.

All types are objects.

Casting for reference types.

Casting for value types.

Common typing with other .NET languages.

10. C# operators.

Operators and their precedence in C#.

Operator overloading.

typeof operator.

checked and unchecked operators and statements.

The # # operator.

The is operator (JavaÎs instanceof operator).

The as operator.

11. Iteration and flow control.

Looping with the while, do, for, continue and break keywords.

Conditional statements using the if and else keywords.

Looping with the foreach keyword.

Conditional statements with the switch and case keywords.

Flow control with the break and continue keywords.

Flow control with the goto keyword.

IV. CORE TOPICS.

12. Arrays.

One-dimensional arrays.

Multi-dimensional arrays: rectangular arrays.

Multi-dimensional arrays: jagged arrays.

Mixing jagged and rectangular arrays.

Using the System.Array class.

13. Exception handling.

Exception examples.

C# exception hierarchy.

Examining System.Exception.

Inner exceptions.

Catching generic exceptions.

14. C# delegates.

What are delegates?

A first delegate example.

Combining delegates.

Removing delegates.

Exception throwing in delegates.

Passing method parameters by reference in delegates.

15. C# events.

Generic event model.

What are C# events?

A full example.

Another full example.

16. Reflection and dynamic method invocation.

Retrieving the type of an instance.

Retrieving the type from a name of a class.

Retrieving methods from a type.

Retrieving modules from an assembly.

Dynamically invoking methods in late bound objects.

Creating new types during runtime.

17. Multi-threaded programming.

Multi-threading.

Thread states and multi-threading in C#.

Thread synchronization.

Threading guidelines.

18. File I/O.

Copying, moving, and deleting files.

Copying, moving, and deleting directories.

Reading from or writing to binary files.

Reading from and writing to text files.

19. C# collection classes.

ArrayList.

BitArray.

Hashtable.

Queue.

SortedList.

Stack.

V. Convenience features.

20. C# properties.

Properties as a replacement for accessor and mutator methods.

Having only either the get or set section.

Inheritance of properties.

21. C# indexes.

Overloading indexers.

Wrong use of indexers.

22. Operator overloading.

Explaining operator overloading.

Operator overloading proper.

Another example of operator overloading.

23. User-defined conversions/casts.

The implicit and explicit keywords.

Syntax of user-defined conversion method declarations.

VI. C#-specific features.

24. C# preprocessor directives.

Conditional compilation with #define, #undef, #if and #endif.

#else and #elif.

The /define compiler option and #undef.

#warning and #error.

#region and #endregion.

25. Using enums.

Specifying different int values for enum elements.

26. C# structures.

First look at structs.

Differences between a struct and a class.

Why use a struct?

27. C# attributes.

First look at attributes.

Standard attributes.

28. Writing custom attributes.

An attribute class.

Another custom attribute example.

Naming attribute classes and attribute specifications.

Custom attributes in depth.

The AttributeUsage attribute.

29. Writing unsafe codes.

Definitions.

Comparing Java and C#/.NET.

Introducing pointers.

Using the unsafe keyword.

Declaring pointers.

Using the & address-of operator.

Using the * indirection operator.

Passing pointers to methods.

Using the -> member access operator.

Using the sizeof operator.

Pointer casting.

Pointer arithmetic.

Using the fixed keyword.

A further example.

VII. APPENDICES.

Appendix A: Keywords in C#.
Appendix B: Comparing Java and C# keywords.
Appendix C: C# coding conventions.
Appendix D: XML documentation.
Appendix E: C# command line tools.
Appendix F: About .NET assemblies.

What is an assembly?

Shared assemblies and the GAC.

What is DLL hell?

Creating DLL assemblies using csc.exe.

Compiling to modules.

Referencing an external module during compilation of an assembly.

Appendix G: Abbreviations used in this book.

商品描述(中文翻譯)

目錄:


關於作者。
前言。

介紹。

致謝。


I. 介紹 .NET 和 C#。



1. 介紹 .NET。


演變:從 COM 到 .NET。



.NET 到底是什麼?



多種 .NET 程式語言和 VS
.NET。



中介語言。



.NET 共通語言執行環境。



與 Java 技術並行競爭。



共通語言基礎結構。



其他相關的 .NET 技術。



不安全的程式碼和即時程式。



將 .NET 移植到其他作業系統。



2. 介紹 C#。


強大的 Java 和 C# 組合!



3. 跳到 .NET 和 J#。


Java 語言轉換助手。



J# 語言。



4. Hello C#!


如何編譯和執行本書中的程式碼範例。



一些 .NET 特定的事項。



反組譯組件檔案。


II. 類別、方法和其他物件導向的內容。



5. 入門。


基本類別結構。



基本的控制台輸入輸出。



C# 命名空間(Java 套件)。



6. 類別問題。


類別修飾詞。



類別成員。



使用 new 運算子建立物件。



查看 System.Object。



類別繼承。



實作介面。



密封類別(Java final 類別)。



抽象類別。



巢狀類別(Java 內部類別)。



7. 方法問題。


方法修飾詞。



方法基礎知識。



實例建構函式。



靜態建構函式(Java 靜態初始化程式區塊)。



解構函式。



建構函式初始化和建構函式鏈接。



方法重載。



將變數數量傳遞給 C# 方法。



抽象方法。



使用虛擬和覆寫修飾詞進行方法覆寫。



使用 new 修飾詞進行方法隱藏。