SlideShare a Scribd company logo
C#
for Java Developers
dhaval.dalal@software-artisan.com
@softwareartisan
A Broad Overview
.NET Platform JVM Platform
IL
Intermediate
Language
Bytecode
C# F# VB.NET Java Groovy Scala
CLR
(Common Language Runtime)
Win Win Mac UnixLinux
csc javac
groovyc
fsc
vbc
scalac
JRE
(Java Runtime Environment)
Mono
Technology Stack
Java C#
Data Access
Client Side GUI
Web Side GUI
Web Scripting
Web Hosting
Remote Invocation
Messaging
Native
Directory Access
Componentization
JDBC ADO.NET
AWT/Swing WinForms, WPF
JSP, JavaFX, JSF ASP.NET, WebForms
Servlets, Filters
ISAPI, HttpHandler,
HttpModule
Tomcat, Jetty, Weblogic
etc...
IIS
RMI, Netty, AKKA Remoting, now part of WCF
JMS, AKKA MSMQ
JNI PInvoke
JNDI Active Directory (Ldap/ADSI)
EJB (Entity/Session), Spring
COM+, Managed Extensibility
Framework (MEF)
Language Comparison
Java C#
Program Entry Point
Namespace
Including Classes
Inheritance
Overriding
Accessing Parent Ctor
Accessing Parent Method
Visibility
main(String ...args)
Main() or
Main(string [] args)
package namespace
import using
class (extends),
interface (implements)
class and interface (:)
virtual by default
non-virtual by default
use virtual keyword
super(...) : base(...)
super.method(...) base.Method(...)
private, package,
protected, public
private, protected, internal,
internal protected, public
Language Comparison
Java C#
Abstract Class
Non-Extensible Class
Non-Writable Field
Non-Extensible Method
Constant
Checking Instance Type
Enums
for-each construct
Switch-Case
abstract class X { ... } abstract class X { ... }
final class X { ... } sealed class X { ... }
final readonly
final sealed
static final const
instanceof is
enum, can have fields, methods and
implement interfaces and are typesafe
enum, cannot have methods,
fields or implement
interfaces, not typesafe
for (item : collection)
{ ... }
foreach(item in collection)
{ ... }
numeric types (int,
float...) enums, and now
strings (in Java 7)
numeric types, enums and
strings
Language Comparison
Java C#
Method Parameters
Variable Arguments
Exceptions
ADT Meta Type
Meta Information
Static class
Properties
Non-Deterministic Object
Cleanup
Object References are
passed by Value only
Object reference are passed
by Value(default), ref & out
method(type... args) Method(params type[] args)
Checked and Unchecked
(enforced by javac, not by JIT
compiler)
All Unchecked Exceptions
Class
Class klass = X.class;
Type
Type type = typeof(X);
@Annotation [Attribute]
Simulated by private Ctor
and static methods
Static class and ctor with
static methods
getProperty(),
setProperty()
Property { get; set; }
compiler generated
get_Property() and
set_Property() methods
finalize() destructor ~X()
Language Comparison
Java C#
Deterministic Object Cleanup
Generics
Class Loading
synchronized block
synchronized method
Thread Local Storage
Smallest Deployment Unit
Signing
AutoCloseable or Closeable
try-with-resources (Java 7)
try ( ... ) { ... }
IDisposable
using ( ... ) { ... }
<T>, <T extends Type>, <?>
Type Erasure
<T>, where T : type, new()
Preserves Type Info
Class.forName(“fqn”)
ClassLoader.getResources()
Activator.CreateInstance<T>()
Assembly.Load()
synchronized (this) { ... } lock (this) { ... }
synchronized method()
{ ... }
[MethodImpl(MethodImplOptions.Synchronized)]
void Method() { ... }
Thread relative static fields
Thread relative static fields
[ThreadStatic] and Data Slots
Jar
EXE/DLL
Private Assembly, Shared Assembly
Jar Signing Assembly Signing
Specific to C#
• Aliases
• Verbatim Strings
• var
• Partial Class/Method
• Object Initializer
• Named Args
• Optional Args
• Value Types(struct)
• Nullable Types
• Safe Cast
• Tuples
• Extension Methods
• Operator Overloading
• Indexer
Value Type
or
Ref Type?
Value Type
use ==
Reference Type use
ReferenceEquals
Specific to C#: Equality
• ForValue Types, default Equals implementation uses
reflection on fields.
• Override Equals for Reference Types
• Use the same strategy forValue Types, it is more
performant and consistent as well.
Equality Similarities
• Define Equals(object other) and hashCode as a
part of the contract
• Define both in terms of immutable fields
• It should be
• Reflexive: x.Equals(x) => True
• Symmetric: if x.Equals(y) then y.Equals(x) => True
• Transitive: x.Equals(y) and y.Equals(z), then x.Equals(z) =>
True
Specific to C#: Equality
• Use Exact object argument - Equals for use in
Collections and for performance.
• IEquatable<T>
• PreserveValue Semantics forValue Types
• Overload == operator
Implicit & Explicit
Interfaces
01. interface Greet1 {
02. public String greet();
03. }
04.
05. interface Greet2 {
06. public String greet();
07. }
08.
09. public class Greeter implements Greet1, Greet2 {
10. //Implicit Implementation
11. public String greet() {
12. {
13. return “Hello”;
14. }
15.
16. public static void main(String ...args) {
17. Greet1 greeter1 = new Greeter();
18. greeter1.greet(); // Hello
19.
20. Greet2 greeter2 = new Greeter();
21. greeter2.greet(); // Hello
22.
23. Greeter greeter = new Greeter();
24. greeter.greet(); // Hello
25. }
26. }
Implicit & Explicit
Interfaces
01. interface Greet1 {
02. public String greet();
03. }
04.
05. interface Greet2 {
06. public String greet();
07. }
08.
09. public class Greeter implements Greet1, Greet2 {
10. //Implicit Implementation
11. public String greet() {
12. {
13. return “Hello”;
14. }
15.
16. public static void main(String ...args) {
17. Greet1 greeter1 = new Greeter();
18. greeter1.greet(); // Hello
19.
20. Greet2 greeter2 = new Greeter();
21. greeter2.greet(); // Hello
22.
23. Greeter greeter = new Greeter();
24. greeter.greet(); // Hello
25. }
26. }
Java: Implicit means whether you use Greet1 or
Greet2, it invokes the same implementation.
Implicit & Explicit
Interfaces
01. interface Greet1 {
02. public String greet();
03. }
04.
05. interface Greet2 {
06. public String greet();
07. }
08.
09. public class Greeter implements Greet1, Greet2 {
10. //Implicit Implementation
11. public String greet() {
12. {
13. return “Hello”;
14. }
15.
16. public static void main(String ...args) {
17. Greet1 greeter1 = new Greeter();
18. greeter1.greet(); // Hello
19.
20. Greet2 greeter2 = new Greeter();
21. greeter2.greet(); // Hello
22.
23. Greeter greeter = new Greeter();
24. greeter.greet(); // Hello
25. }
26. }
Java: Implicit means whether you use Greet1 or
Greet2, it invokes the same implementation.
01. interface Greet1
02. {
03. string Greet();
04. }
05. interface Greet2
06. {
07. string Greet();
08. }
09. public class Greeter : Greet1, Greet2
10. {
11. //Implicit Implementation
12. public string Greet() //Note the Visibility here
13. {
14. return “Hello”;
15. }
16.
17. public static void Main()
18. {
19. Greet1 greeter1 = new Greeter();
20. greeter1.Greet(); // Hello
21. Greet2 greeter2 = new Greeter();
22. greeter2.Greet(); // Hello
23. Greeter greeter = new Greeter();
24. greeter.Greet(); // Hello
25. }
26. }
Implicit & Explicit
Interfaces
01. interface Greet1 {
02. public String greet();
03. }
04.
05. interface Greet2 {
06. public String greet();
07. }
08.
09. public class Greeter implements Greet1, Greet2 {
10. //Implicit Implementation
11. public String greet() {
12. {
13. return “Hello”;
14. }
15.
16. public static void main(String ...args) {
17. Greet1 greeter1 = new Greeter();
18. greeter1.greet(); // Hello
19.
20. Greet2 greeter2 = new Greeter();
21. greeter2.greet(); // Hello
22.
23. Greeter greeter = new Greeter();
24. greeter.greet(); // Hello
25. }
26. }
Java: Implicit means whether you use Greet1 or
Greet2, it invokes the same implementation.
01. interface Greet1
02. {
03. string Greet();
04. }
05. interface Greet2
06. {
07. string Greet();
08. }
09. public class Greeter : Greet1, Greet2
10. {
11. //Implicit Implementation
12. public string Greet() //Note the Visibility here
13. {
14. return “Hello”;
15. }
16.
17. public static void Main()
18. {
19. Greet1 greeter1 = new Greeter();
20. greeter1.Greet(); // Hello
21. Greet2 greeter2 = new Greeter();
22. greeter2.Greet(); // Hello
23. Greeter greeter = new Greeter();
24. greeter.Greet(); // Hello
25. }
26. }
C#: Implicit interface implementation
Specific to C#: Explicit
Interfaces
Specific to C#: Explicit
Interfaces01. interface Greet1 // v1.0
02. {
03. string Greet();
04. }
05. interface Greet2 //v2.0
06. {
07. string Greet();
08. }
09. public class Greeter : Greet1, Greet2
10. {
11. //Explicit Implementations
12. string Greet1.Greet() //Note the Visibility here
13. {
14. return “Hello from 1”;
15. }
16. string Greet2.Greet() //public not allowed for explicit
17. {
18. return “Hello from 2”;
19. }
20. public static void Main()
21. {
22. Greet1 greeter1 = new Greeter();
23. greeter1.Greet(); // Hello from 1
24. Greet2 greeter2 = new Greeter();
25. greeter2.Greet(); // Hello from 2
26. Greeter greeter = new Greeter();
27. greeter. // No Greeters to Greet unless I cast
28. }
29. }
Specific to C#: Explicit
Interfaces01. interface Greet1 // v1.0
02. {
03. string Greet();
04. }
05. interface Greet2 : Greet1 // v2.0
06. {
07. new string Greet();
08. }
09. public class Greeter : Greet2
10. {
11. //Explicit Implementations
12. string Greet1.Greet() //Note the Visibility here
13. {
14. return “Hello from 1”;
15. }
16. string Greet2.Greet() //public not allowed for explicit
17. {
18. return “Hello from 2”;
19. }
20. public static void Main()
21. {
22. Greet1 greeter1 = new Greeter();
23. greeter1.Greet(); // Hello from 1
24. Greet2 greeter2 = new Greeter();
25. greeter2.Greet(); // Hello from 2
26. Greeter greeter = new Greeter();
27. greeter. // No Greeters to Greet unless I cast
28. }
29. }
01. interface Greet1 // v1.0
02. {
03. string Greet();
04. }
05. interface Greet2 //v2.0
06. {
07. string Greet();
08. }
09. public class Greeter : Greet1, Greet2
10. {
11. //Explicit Implementations
12. string Greet1.Greet() //Note the Visibility here
13. {
14. return “Hello from 1”;
15. }
16. string Greet2.Greet() //public not allowed for explicit
17. {
18. return “Hello from 2”;
19. }
20. public static void Main()
21. {
22. Greet1 greeter1 = new Greeter();
23. greeter1.Greet(); // Hello from 1
24. Greet2 greeter2 = new Greeter();
25. greeter2.Greet(); // Hello from 2
26. Greeter greeter = new Greeter();
27. greeter. // No Greeters to Greet unless I cast
28. }
29. }
Specific to C#: Explicit
Interfaces01. interface Greet1 // v1.0
02. {
03. string Greet();
04. }
05. interface Greet2 : Greet1 // v2.0
06. {
07. new string Greet();
08. }
09. public class Greeter : Greet2
10. {
11. //Explicit Implementations
12. string Greet1.Greet() //Note the Visibility here
13. {
14. return “Hello from 1”;
15. }
16. string Greet2.Greet() //public not allowed for explicit
17. {
18. return “Hello from 2”;
19. }
20. public static void Main()
21. {
22. Greet1 greeter1 = new Greeter();
23. greeter1.Greet(); // Hello from 1
24. Greet2 greeter2 = new Greeter();
25. greeter2.Greet(); // Hello from 2
26. Greeter greeter = new Greeter();
27. greeter. // No Greeters to Greet unless I cast
28. }
29. }
01. interface Greet1 // v1.0
02. {
03. string Greet();
04. }
05. interface Greet2 //v2.0
06. {
07. string Greet();
08. }
09. public class Greeter : Greet1, Greet2
10. {
11. //Explicit Implementations
12. string Greet1.Greet() //Note the Visibility here
13. {
14. return “Hello from 1”;
15. }
16. string Greet2.Greet() //public not allowed for explicit
17. {
18. return “Hello from 2”;
19. }
20. public static void Main()
21. {
22. Greet1 greeter1 = new Greeter();
23. greeter1.Greet(); // Hello from 1
24. Greet2 greeter2 = new Greeter();
25. greeter2.Greet(); // Hello from 2
26. Greeter greeter = new Greeter();
27. greeter. // No Greeters to Greet unless I cast
28. }
29. }
Explicitly State the interface for which the
implementation is
Similarities
• Immutable Strings
• Serialization
• Boxing
• ConvertValue Type to a Reference Type
• Unboxing
• Convert Reference Type to aValue Type
Similarities
• Collections
• C# - IList, IDictionary, Queue, Stack
• Java - List, Map, Queue, Stack
• for-each Collection Iterators
Specific to C#
• Collection Initializer
• Coroutines (more precisely Generators)
• yield break
• yield return
01. public static void Main() {
02. foreach(int fiboSeq in new Fibonacci(5)) {
03. Console.Out.WriteLine("{0}", fiboSeq);
04. }
05. }
Output:
0
1
1
2
3
5
Specific to C#
• Collection Initializer
• Coroutines (more precisely Generators)
• yield break
• yield return
01. class Fibonacci : IEnumerable<int> {
02. private readonly int howMany;
03. private int firstSeed, secondSeed = 1;
04.
05. public Fibonacci(int howMany)
06. {
07. this.howMany = howMany;
08. }
09.
10. public IEnumerator<int> GetEnumerator()
11. {
12. if (howMany < 0)
13. {
14. yield break;
15. }
16. for (var i = 0; i <= howMany; i++)
17. {
18. yield return firstSeed;
19. var sum = firstSeed + secondSeed;
20. firstSeed = secondSeed;
21. secondSeed = sum;
22. }
23. }
24.
25. IEnumerator IEnumerable.GetEnumerator()
26. {
27. return GetEnumerator();
28. }
29. }
01. public static void Main() {
02. foreach(int fiboSeq in new Fibonacci(5)) {
03. Console.Out.WriteLine("{0}", fiboSeq);
04. }
05. }
Output:
0
1
1
2
3
5
Covariance &
Contravariance
• Covariance
• Pass collection of sub-class to a collection of base class
• Contravariance
• Pass collection of base class to a collection of sub-class
• Invariance
• Neither of the above applies
Arrays and Generic
Collections
• Arrays are Covariant in C# and Java
• There is a hole in the type system and a runtime patch is
applied.
• Generics are Invariant in Java.
• In C#, use leniency offered by IEnumerable if you
need Covariance.
• Only interfaces and delegates can be covariant (out) or
contravariant (in)
C# Example
C# Example
01. abstract class Animal {
02. public abstract string Speak();
03. }
04.
05. class Cat : Animal {
06. public string Speak() {
07. return “Meow!”;
08. }
09. }
10.
11. class Dog : Animal {
12. public string Speak() {
13. return “Bark!”;
14. }
15. }
16.
17. class Printer {
18. public static Print(Animal [] animals) {
19. animals[0] = new Dog();
20. for (var i = 0; i < animals.Length; i++) {
21. System.out.println(animals[i].speak();
22. }
23. }
24.
25. public static Print(IList<Animal> animals) {
26. for (var animal in animals) {
27. System.out.println(animal.Speak());
28. }
29. }
30.
C# Example
01. abstract class Animal {
02. public abstract string Speak();
03. }
04.
05. class Cat : Animal {
06. public string Speak() {
07. return “Meow!”;
08. }
09. }
10.
11. class Dog : Animal {
12. public string Speak() {
13. return “Bark!”;
14. }
15. }
16.
17. class Printer {
18. public static Print(Animal [] animals) {
19. animals[0] = new Dog();
20. for (var i = 0; i < animals.Length; i++) {
21. System.out.println(animals[i].speak();
22. }
23. }
24.
25. public static Print(IList<Animal> animals) {
26. for (var animal in animals) {
27. System.out.println(animal.Speak());
28. }
29. }
30.
01. public static Print(IEnumerable<Animal> animals)
02. {
03. for (var animal in animals) {
04. Console.Out.WriteLine(animal.Speak());
05. }
06. }
07. }
08. class TestCollections {
09. public static void main(String []args) {
10. Cat cat = new Cat();
11. Animal animal = cat;
12. animal.speak();
13.
14. animal = new Dog();
15. animal.speak();
16.
17. Animal [] animals = new Animal [] { cat, dog };
18. Cat [] cats = new Cat[] { cat };
19. animals = cats;
20. Print(animals); //Exposes Hole in Type System
21.
22. // In absence of above Print method, the code
23. // does not compile as Generic Collections in
24. // C# are Invariant.
25. List<Animal> animals = new ArrayList<Dog>();
26
27. //We need Co-variance to allow this to compile
28. Printer.Print(dogs);
29.
30. }
31. }
Java Example
Java Example
01. abstract class Animal {
02. public abstract String speak();
03. }
04.
05. class Cat extends Animal {
06. public String speak() {
07. return “Meow!”;
08. }
09. }
10.
11. class Dog extends Animal {
12. public String speak() {
13. return “Bark!”;
14. }
15. }
16.
17. class Printer {
18. public static print(Animal [] animals) {
19. animals[0] = new Dog();
20. for (int i = 0; i < animals.length; i++) {
21. System.out.println(animals[i].speak();
22. }
23. }
24.
25. public static print(List<Animal> animals) {
26. for(Animal animal : animals) {
27. System.out.println(animal.speak());
28. }
29. }
30. }
Java Example
01. class TestCollections {
02. public static void main(String []args) {
03. Cat cat = new Cat();
04. Animal animal = cat;
05. animal.speak();
06.
07. animal = new Dog();
08. animal.speak();
09.
10. Animal [] animals = new Animal [] { cat, dog };
11. Cat [] cats = new Cat[] { cat };
12. animals = cats;
13. print(animals); //Exposes Hole in Type System
14.
15. // Fails to compile as Generic Collections in
16. // Java are Invariant
17. List<Animal> animals = new ArrayList<Dog>();
18.
19. List<Dog> dogs = new ArrayList<Dog>();
20. dogs.add(dog);
21. dogs.add(dog);
22. print(dogs);
23. }
24. }
01. abstract class Animal {
02. public abstract String speak();
03. }
04.
05. class Cat extends Animal {
06. public String speak() {
07. return “Meow!”;
08. }
09. }
10.
11. class Dog extends Animal {
12. public String speak() {
13. return “Bark!”;
14. }
15. }
16.
17. class Printer {
18. public static print(Animal [] animals) {
19. animals[0] = new Dog();
20. for (int i = 0; i < animals.length; i++) {
21. System.out.println(animals[i].speak();
22. }
23. }
24.
25. public static print(List<Animal> animals) {
26. for(Animal animal : animals) {
27. System.out.println(animal.speak());
28. }
29. }
30. }
Specific to C#
• Anonymous Types
• Anonymous Methods/Delegates
• Pass Methods as Data
• Action: No return values
• Func: Non-void return values
• Predicate: A Func that always returns a bool
• Generally above suffice, but if not,then use Custom Delegates
• Delegate Chaining
• Compiler Eye Candy: +=, -= for Combine(), Remove()
• Lambdas
Specific to C#
• Events
• Syntactic sugar over delegates, but with visibility
• Events can only be invoked from within the class that declared it, whereas a
delegate field can be invoked by whoever has access to it.
• Events can be included in interfaces, delegates cannot be.
• Built-in EventHandler and EventArgs
• Compiler generated add_ and remove_ methods for
the event.
• dynamic
• ExpandoObject
Dynamic Runtime Library
CLR
(Common Language Runtime)
DLR
(Dynamic Language Runtime)
C#
VB.NET
Python
Ruby
• Allows you to talk with
implementations in other
languages
• C#/VB.NET with Python, Ruby
• Also with Silverlight etc..
Dynamically Typed
Statically Typed
01. using IronPython.Hosting;
02. using Microsoft.Scripting.Hosting;
03.
04. var python = Python.CreateRuntime();
05. dynamic script = python.UseFile(“Calculator.py”);
06.
07. // Get PythonType
08. dynamic Calculator = script.GetVariable(“Calculator”);
09. dynamic calc = Calculator(); // Instantiate Object
10.
11. //Invoke method
12. dynamic result = calc.add(2, 3); // 5
Specific to C#
• Avoid Configuration hell
• Single Configuration File (App.config)
• Asynchronous Programming
• BeginInvoke and EndInvoke
• Wait with EndInvoke
• Wait with WaitHandle
• Poll for Async call completion
• Execute a callback upon completion
• Task Parallel Library (TPL)
Specific to Java
• Static Imports
• Instance and Static Initializers
• Interfaces Containing Fields
• Anonymous Classes
• Proxy Support through Interceptor
Specific to Java
• Asynchronous Programming
• Future Task
• Poll Completion with isDone().
• Execute callback upon completion
• Using ListenableFuture and FutureCallback - Google Guava Library
• Or roll your own result completion callback.
• Akka Actors
Frameworks and Tools
Java C#
Dependency Injection
Frameworks
ORM Frameworks
Proxying/AOP Frameworks
TDD Frameworks
Mocking Frameworks
BDD Frameworks
Build Tools
Coverage Tools
Profiler
Code Analysis Tools
Spring, Guice, Pico
Container etc...
Spring.NET, Unity Container
Hibernate, iBatis etc...
NHibernate, Entity
Framework
JDK Proxy, Spring AOP, CGLib
AspectJ, AspectWerkz
Castle Proxy, Rhino Proxy,
Unity Interceptor
JUnit, TestNG NUnit, MSTest
JMock2, Mockito, EasyMock Rhino Mocks, Moq, TypeMock
Cucumber, JBehave, Spock,
Easyb
NBehave, SpecFlow, NSpec
Ant, Maven, Gradle, Ivy NAnt, MSBuild, NMaven
Cobertura, Emma, Clover NCover, OpenCover
JProfiler, YourKit dotTrace, YourKit.NET
FindBugs, PMD, Checkstyle,
JDepend
FxCop, NDepend, ReSharper,
Simian
References
• MSDN Site
• Venkat Subramaniam
• http://agiledeveloper.com/presentations/CSharpForJavaProgrammers.zip
• Wikipedia
• http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java
• Dare Obasanjo
• http://www.25hoursaday.com/CsharpVsJava.html
• Scott Hanselman
• http://www.hanselman.com/blog/
C4AndTheDynamicKeywordWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx

More Related Content

What's hot

02 - Basics of Qt
02 - Basics of Qt02 - Basics of Qt
02 - Basics of Qt
Andreas Jakl
 
Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++
corehard_by
 
Braga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingBraga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programming
Emanuel Mota
 
T-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIMLT-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIML
mniemi
 
A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...
Daniele Gianni
 
Surface flingerservice(서피스플링거서비스초기화)
Surface flingerservice(서피스플링거서비스초기화)Surface flingerservice(서피스플링거서비스초기화)
Surface flingerservice(서피스플링거서비스초기화)
fefe7270
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++
Yandex
 
Os2
Os2Os2
Os2
issbp
 
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
Henri Tremblay
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
Alex Miller
 
Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?
Artur Latoszewski
 
Final requirement in programming
Final requirement in programmingFinal requirement in programming
Final requirement in programming
trish_maxine
 
Tutorial s crypto api session keys
Tutorial   s crypto api session keysTutorial   s crypto api session keys
Tutorial s crypto api session keys
Dr. Edwin Hernandez
 
IKH331-07-java-rmi
IKH331-07-java-rmiIKH331-07-java-rmi
IKH331-07-java-rmi
Anung Ariwibowo
 
The mighty js_function
The mighty js_functionThe mighty js_function
The mighty js_function
timotheeg
 
Circuit breaker
Circuit breakerCircuit breaker
Circuit breaker
bricemciver
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
Thierry Wasylczenko
 
#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG
Thierry Wasylczenko
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Yandex
 
Treinamento Qt básico - aula II
Treinamento Qt básico - aula IITreinamento Qt básico - aula II
Treinamento Qt básico - aula II
Marcelo Barros de Almeida
 

What's hot (20)

02 - Basics of Qt
02 - Basics of Qt02 - Basics of Qt
02 - Basics of Qt
 
Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++
 
Braga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingBraga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programming
 
T-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIMLT-121-5300 (2008) User Interface Design 10 - UIML
T-121-5300 (2008) User Interface Design 10 - UIML
 
A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...
 
Surface flingerservice(서피스플링거서비스초기화)
Surface flingerservice(서피스플링거서비스초기화)Surface flingerservice(서피스플링거서비스초기화)
Surface flingerservice(서피스플링거서비스초기화)
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++
 
Os2
Os2Os2
Os2
 
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?Kotlin coroutine - the next step for RxJava developer?
Kotlin coroutine - the next step for RxJava developer?
 
Final requirement in programming
Final requirement in programmingFinal requirement in programming
Final requirement in programming
 
Tutorial s crypto api session keys
Tutorial   s crypto api session keysTutorial   s crypto api session keys
Tutorial s crypto api session keys
 
IKH331-07-java-rmi
IKH331-07-java-rmiIKH331-07-java-rmi
IKH331-07-java-rmi
 
The mighty js_function
The mighty js_functionThe mighty js_function
The mighty js_function
 
Circuit breaker
Circuit breakerCircuit breaker
Circuit breaker
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG
 
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан КольцовRust: код может быть одновременно безопасным и быстрым, Степан Кольцов
Rust: код может быть одновременно безопасным и быстрым, Степан Кольцов
 
Treinamento Qt básico - aula II
Treinamento Qt básico - aula IITreinamento Qt básico - aula II
Treinamento Qt básico - aula II
 

Viewers also liked

Beyond Full Stack Engineering
Beyond Full Stack EngineeringBeyond Full Stack Engineering
Beyond Full Stack Engineering
Adam Hepton
 
Full Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYC
Full Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYCFull Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYC
Full Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYC
Karl Stanton
 
Cloud Based Business Application Development
Cloud Based Business Application DevelopmentCloud Based Business Application Development
Cloud Based Business Application Development
MageCloud
 
Full stack development
Full stack developmentFull stack development
Full stack development
Arnav Gupta
 
Technology stack of social networks [MTS]
Technology stack of social networks [MTS]Technology stack of social networks [MTS]
Technology stack of social networks [MTS]
philmaweb
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
Husain Ali
 
Introduction to Web Technology Stacks
Introduction to Web Technology StacksIntroduction to Web Technology Stacks
Introduction to Web Technology Stacks
Prakarsh -
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
Tejasvi Rastogi
 
Creating an Interactive Content Strategy that Works with Technology
Creating an Interactive Content Strategy that Works with TechnologyCreating an Interactive Content Strategy that Works with Technology
Creating an Interactive Content Strategy that Works with Technology
ion interactive
 
Developing an Intranet Strategy
Developing an Intranet StrategyDeveloping an Intranet Strategy
Developing an Intranet Strategy
DNN
 
The Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The FutureThe Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The Future
Arturo Pelayo
 

Viewers also liked (11)

Beyond Full Stack Engineering
Beyond Full Stack EngineeringBeyond Full Stack Engineering
Beyond Full Stack Engineering
 
Full Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYC
Full Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYCFull Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYC
Full Stack Engineering - April 29th, 2014 @ Full Stack Engineering Meetup NYC
 
Cloud Based Business Application Development
Cloud Based Business Application DevelopmentCloud Based Business Application Development
Cloud Based Business Application Development
 
Full stack development
Full stack developmentFull stack development
Full stack development
 
Technology stack of social networks [MTS]
Technology stack of social networks [MTS]Technology stack of social networks [MTS]
Technology stack of social networks [MTS]
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
 
Introduction to Web Technology Stacks
Introduction to Web Technology StacksIntroduction to Web Technology Stacks
Introduction to Web Technology Stacks
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 
Creating an Interactive Content Strategy that Works with Technology
Creating an Interactive Content Strategy that Works with TechnologyCreating an Interactive Content Strategy that Works with Technology
Creating an Interactive Content Strategy that Works with Technology
 
Developing an Intranet Strategy
Developing an Intranet StrategyDeveloping an Intranet Strategy
Developing an Intranet Strategy
 
The Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The FutureThe Future Of Work & The Work Of The Future
The Future Of Work & The Work Of The Future
 

Similar to Understanding c# for java

Test Engine
Test EngineTest Engine
Test Engine
guestcdaa2dc
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
Alex Miller
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
Azul Systems, Inc.
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
Doug Hawkins
 
Test Engine
Test EngineTest Engine
Test Engine
guestcdaa2dc
 
Java Full Throttle
Java Full ThrottleJava Full Throttle
Java Full Throttle
José Paumard
 
Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge
Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume LaforgeGroovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge
Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge
Guillaume Laforge
 
ikh331-06-distributed-programming
ikh331-06-distributed-programmingikh331-06-distributed-programming
ikh331-06-distributed-programming
Anung Ariwibowo
 
Multithreading in Java
Multithreading in JavaMultithreading in Java
Multithreading in Java
Appsterdam Milan
 
Java Socket Programming
Java Socket ProgrammingJava Socket Programming
Java Socket Programming
Vipin Yadav
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
Nick Plante
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
jobandesther
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
Sunil OS
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
Sven Efftinge
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin Compiler
Garth Gilmour
 
Java осень 2012 лекция 2
Java осень 2012 лекция 2Java осень 2012 лекция 2
Java осень 2012 лекция 2
Technopark
 
Devoxx 2012 (v2)
Devoxx 2012 (v2)Devoxx 2012 (v2)
Devoxx 2012 (v2)
Jerome Dochez
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
Mattia Battiston
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
Murat Yener
 
Interface
InterfaceInterface
Interface
kamal kotecha
 

Similar to Understanding c# for java (20)

Test Engine
Test EngineTest Engine
Test Engine
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Test Engine
Test EngineTest Engine
Test Engine
 
Java Full Throttle
Java Full ThrottleJava Full Throttle
Java Full Throttle
 
Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge
Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume LaforgeGroovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge
Groovy: to Infinity and Beyond -- JavaOne 2010 -- Guillaume Laforge
 
ikh331-06-distributed-programming
ikh331-06-distributed-programmingikh331-06-distributed-programming
ikh331-06-distributed-programming
 
Multithreading in Java
Multithreading in JavaMultithreading in Java
Multithreading in Java
 
Java Socket Programming
Java Socket ProgrammingJava Socket Programming
Java Socket Programming
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 
Networking and Data Access with Eqela
Networking and Data Access with EqelaNetworking and Data Access with Eqela
Networking and Data Access with Eqela
 
C# Variables and Operators
C# Variables and OperatorsC# Variables and Operators
C# Variables and Operators
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin Compiler
 
Java осень 2012 лекция 2
Java осень 2012 лекция 2Java осень 2012 лекция 2
Java осень 2012 лекция 2
 
Devoxx 2012 (v2)
Devoxx 2012 (v2)Devoxx 2012 (v2)
Devoxx 2012 (v2)
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
Interface
InterfaceInterface
Interface
 

More from sagaroceanic11

Module 21 investigative reports
Module 21 investigative reportsModule 21 investigative reports
Module 21 investigative reportssagaroceanic11
 
Module 20 mobile forensics
Module 20 mobile forensicsModule 20 mobile forensics
Module 20 mobile forensicssagaroceanic11
 
Module 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimesModule 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimes
sagaroceanic11
 
Module 18 investigating web attacks
Module 18 investigating web attacksModule 18 investigating web attacks
Module 18 investigating web attacks
sagaroceanic11
 
Module 17 investigating wireless attacks
Module 17 investigating wireless attacksModule 17 investigating wireless attacks
Module 17 investigating wireless attacks
sagaroceanic11
 
Module 04 digital evidence
Module 04 digital evidenceModule 04 digital evidence
Module 04 digital evidence
sagaroceanic11
 
Module 03 searching and seizing computers
Module 03 searching and seizing computersModule 03 searching and seizing computers
Module 03 searching and seizing computers
sagaroceanic11
 
Module 01 computer forensics in todays world
Module 01 computer forensics in todays worldModule 01 computer forensics in todays world
Module 01 computer forensics in todays world
sagaroceanic11
 
Virtualisation with v mware
Virtualisation with v mwareVirtualisation with v mware
Virtualisation with v mware
sagaroceanic11
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overview
sagaroceanic11
 
Virtualisation basics
Virtualisation basicsVirtualisation basics
Virtualisation basics
sagaroceanic11
 
Introduction to virtualisation
Introduction to virtualisationIntroduction to virtualisation
Introduction to virtualisation
sagaroceanic11
 
6 service operation
6 service operation6 service operation
6 service operation
sagaroceanic11
 
5 service transition
5 service transition5 service transition
5 service transition
sagaroceanic11
 
4 service design
4 service design4 service design
4 service design
sagaroceanic11
 
3 service strategy
3 service strategy3 service strategy
3 service strategy
sagaroceanic11
 
2 the service lifecycle
2 the service lifecycle2 the service lifecycle
2 the service lifecycle
sagaroceanic11
 
1 introduction to itil v[1].3
1 introduction to itil v[1].31 introduction to itil v[1].3
1 introduction to itil v[1].3
sagaroceanic11
 
Visual studio 2008 overview
Visual studio 2008 overviewVisual studio 2008 overview
Visual studio 2008 overview
sagaroceanic11
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
sagaroceanic11
 

More from sagaroceanic11 (20)

Module 21 investigative reports
Module 21 investigative reportsModule 21 investigative reports
Module 21 investigative reports
 
Module 20 mobile forensics
Module 20 mobile forensicsModule 20 mobile forensics
Module 20 mobile forensics
 
Module 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimesModule 19 tracking emails and investigating email crimes
Module 19 tracking emails and investigating email crimes
 
Module 18 investigating web attacks
Module 18 investigating web attacksModule 18 investigating web attacks
Module 18 investigating web attacks
 
Module 17 investigating wireless attacks
Module 17 investigating wireless attacksModule 17 investigating wireless attacks
Module 17 investigating wireless attacks
 
Module 04 digital evidence
Module 04 digital evidenceModule 04 digital evidence
Module 04 digital evidence
 
Module 03 searching and seizing computers
Module 03 searching and seizing computersModule 03 searching and seizing computers
Module 03 searching and seizing computers
 
Module 01 computer forensics in todays world
Module 01 computer forensics in todays worldModule 01 computer forensics in todays world
Module 01 computer forensics in todays world
 
Virtualisation with v mware
Virtualisation with v mwareVirtualisation with v mware
Virtualisation with v mware
 
Virtualisation overview
Virtualisation overviewVirtualisation overview
Virtualisation overview
 
Virtualisation basics
Virtualisation basicsVirtualisation basics
Virtualisation basics
 
Introduction to virtualisation
Introduction to virtualisationIntroduction to virtualisation
Introduction to virtualisation
 
6 service operation
6 service operation6 service operation
6 service operation
 
5 service transition
5 service transition5 service transition
5 service transition
 
4 service design
4 service design4 service design
4 service design
 
3 service strategy
3 service strategy3 service strategy
3 service strategy
 
2 the service lifecycle
2 the service lifecycle2 the service lifecycle
2 the service lifecycle
 
1 introduction to itil v[1].3
1 introduction to itil v[1].31 introduction to itil v[1].3
1 introduction to itil v[1].3
 
Visual studio 2008 overview
Visual studio 2008 overviewVisual studio 2008 overview
Visual studio 2008 overview
 
Vb introduction.
Vb introduction.Vb introduction.
Vb introduction.
 

Recently uploaded

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 

Recently uploaded (20)

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 

Understanding c# for java

  • 2. A Broad Overview .NET Platform JVM Platform IL Intermediate Language Bytecode C# F# VB.NET Java Groovy Scala CLR (Common Language Runtime) Win Win Mac UnixLinux csc javac groovyc fsc vbc scalac JRE (Java Runtime Environment) Mono
  • 3. Technology Stack Java C# Data Access Client Side GUI Web Side GUI Web Scripting Web Hosting Remote Invocation Messaging Native Directory Access Componentization JDBC ADO.NET AWT/Swing WinForms, WPF JSP, JavaFX, JSF ASP.NET, WebForms Servlets, Filters ISAPI, HttpHandler, HttpModule Tomcat, Jetty, Weblogic etc... IIS RMI, Netty, AKKA Remoting, now part of WCF JMS, AKKA MSMQ JNI PInvoke JNDI Active Directory (Ldap/ADSI) EJB (Entity/Session), Spring COM+, Managed Extensibility Framework (MEF)
  • 4. Language Comparison Java C# Program Entry Point Namespace Including Classes Inheritance Overriding Accessing Parent Ctor Accessing Parent Method Visibility main(String ...args) Main() or Main(string [] args) package namespace import using class (extends), interface (implements) class and interface (:) virtual by default non-virtual by default use virtual keyword super(...) : base(...) super.method(...) base.Method(...) private, package, protected, public private, protected, internal, internal protected, public
  • 5. Language Comparison Java C# Abstract Class Non-Extensible Class Non-Writable Field Non-Extensible Method Constant Checking Instance Type Enums for-each construct Switch-Case abstract class X { ... } abstract class X { ... } final class X { ... } sealed class X { ... } final readonly final sealed static final const instanceof is enum, can have fields, methods and implement interfaces and are typesafe enum, cannot have methods, fields or implement interfaces, not typesafe for (item : collection) { ... } foreach(item in collection) { ... } numeric types (int, float...) enums, and now strings (in Java 7) numeric types, enums and strings
  • 6. Language Comparison Java C# Method Parameters Variable Arguments Exceptions ADT Meta Type Meta Information Static class Properties Non-Deterministic Object Cleanup Object References are passed by Value only Object reference are passed by Value(default), ref & out method(type... args) Method(params type[] args) Checked and Unchecked (enforced by javac, not by JIT compiler) All Unchecked Exceptions Class Class klass = X.class; Type Type type = typeof(X); @Annotation [Attribute] Simulated by private Ctor and static methods Static class and ctor with static methods getProperty(), setProperty() Property { get; set; } compiler generated get_Property() and set_Property() methods finalize() destructor ~X()
  • 7. Language Comparison Java C# Deterministic Object Cleanup Generics Class Loading synchronized block synchronized method Thread Local Storage Smallest Deployment Unit Signing AutoCloseable or Closeable try-with-resources (Java 7) try ( ... ) { ... } IDisposable using ( ... ) { ... } <T>, <T extends Type>, <?> Type Erasure <T>, where T : type, new() Preserves Type Info Class.forName(“fqn”) ClassLoader.getResources() Activator.CreateInstance<T>() Assembly.Load() synchronized (this) { ... } lock (this) { ... } synchronized method() { ... } [MethodImpl(MethodImplOptions.Synchronized)] void Method() { ... } Thread relative static fields Thread relative static fields [ThreadStatic] and Data Slots Jar EXE/DLL Private Assembly, Shared Assembly Jar Signing Assembly Signing
  • 8. Specific to C# • Aliases • Verbatim Strings • var • Partial Class/Method • Object Initializer • Named Args • Optional Args • Value Types(struct) • Nullable Types • Safe Cast • Tuples • Extension Methods • Operator Overloading • Indexer
  • 9. Value Type or Ref Type? Value Type use == Reference Type use ReferenceEquals Specific to C#: Equality • ForValue Types, default Equals implementation uses reflection on fields. • Override Equals for Reference Types • Use the same strategy forValue Types, it is more performant and consistent as well.
  • 10. Equality Similarities • Define Equals(object other) and hashCode as a part of the contract • Define both in terms of immutable fields • It should be • Reflexive: x.Equals(x) => True • Symmetric: if x.Equals(y) then y.Equals(x) => True • Transitive: x.Equals(y) and y.Equals(z), then x.Equals(z) => True
  • 11. Specific to C#: Equality • Use Exact object argument - Equals for use in Collections and for performance. • IEquatable<T> • PreserveValue Semantics forValue Types • Overload == operator
  • 12. Implicit & Explicit Interfaces 01. interface Greet1 { 02. public String greet(); 03. } 04. 05. interface Greet2 { 06. public String greet(); 07. } 08. 09. public class Greeter implements Greet1, Greet2 { 10. //Implicit Implementation 11. public String greet() { 12. { 13. return “Hello”; 14. } 15. 16. public static void main(String ...args) { 17. Greet1 greeter1 = new Greeter(); 18. greeter1.greet(); // Hello 19. 20. Greet2 greeter2 = new Greeter(); 21. greeter2.greet(); // Hello 22. 23. Greeter greeter = new Greeter(); 24. greeter.greet(); // Hello 25. } 26. }
  • 13. Implicit & Explicit Interfaces 01. interface Greet1 { 02. public String greet(); 03. } 04. 05. interface Greet2 { 06. public String greet(); 07. } 08. 09. public class Greeter implements Greet1, Greet2 { 10. //Implicit Implementation 11. public String greet() { 12. { 13. return “Hello”; 14. } 15. 16. public static void main(String ...args) { 17. Greet1 greeter1 = new Greeter(); 18. greeter1.greet(); // Hello 19. 20. Greet2 greeter2 = new Greeter(); 21. greeter2.greet(); // Hello 22. 23. Greeter greeter = new Greeter(); 24. greeter.greet(); // Hello 25. } 26. } Java: Implicit means whether you use Greet1 or Greet2, it invokes the same implementation.
  • 14. Implicit & Explicit Interfaces 01. interface Greet1 { 02. public String greet(); 03. } 04. 05. interface Greet2 { 06. public String greet(); 07. } 08. 09. public class Greeter implements Greet1, Greet2 { 10. //Implicit Implementation 11. public String greet() { 12. { 13. return “Hello”; 14. } 15. 16. public static void main(String ...args) { 17. Greet1 greeter1 = new Greeter(); 18. greeter1.greet(); // Hello 19. 20. Greet2 greeter2 = new Greeter(); 21. greeter2.greet(); // Hello 22. 23. Greeter greeter = new Greeter(); 24. greeter.greet(); // Hello 25. } 26. } Java: Implicit means whether you use Greet1 or Greet2, it invokes the same implementation. 01. interface Greet1 02. { 03. string Greet(); 04. } 05. interface Greet2 06. { 07. string Greet(); 08. } 09. public class Greeter : Greet1, Greet2 10. { 11. //Implicit Implementation 12. public string Greet() //Note the Visibility here 13. { 14. return “Hello”; 15. } 16. 17. public static void Main() 18. { 19. Greet1 greeter1 = new Greeter(); 20. greeter1.Greet(); // Hello 21. Greet2 greeter2 = new Greeter(); 22. greeter2.Greet(); // Hello 23. Greeter greeter = new Greeter(); 24. greeter.Greet(); // Hello 25. } 26. }
  • 15. Implicit & Explicit Interfaces 01. interface Greet1 { 02. public String greet(); 03. } 04. 05. interface Greet2 { 06. public String greet(); 07. } 08. 09. public class Greeter implements Greet1, Greet2 { 10. //Implicit Implementation 11. public String greet() { 12. { 13. return “Hello”; 14. } 15. 16. public static void main(String ...args) { 17. Greet1 greeter1 = new Greeter(); 18. greeter1.greet(); // Hello 19. 20. Greet2 greeter2 = new Greeter(); 21. greeter2.greet(); // Hello 22. 23. Greeter greeter = new Greeter(); 24. greeter.greet(); // Hello 25. } 26. } Java: Implicit means whether you use Greet1 or Greet2, it invokes the same implementation. 01. interface Greet1 02. { 03. string Greet(); 04. } 05. interface Greet2 06. { 07. string Greet(); 08. } 09. public class Greeter : Greet1, Greet2 10. { 11. //Implicit Implementation 12. public string Greet() //Note the Visibility here 13. { 14. return “Hello”; 15. } 16. 17. public static void Main() 18. { 19. Greet1 greeter1 = new Greeter(); 20. greeter1.Greet(); // Hello 21. Greet2 greeter2 = new Greeter(); 22. greeter2.Greet(); // Hello 23. Greeter greeter = new Greeter(); 24. greeter.Greet(); // Hello 25. } 26. } C#: Implicit interface implementation
  • 16. Specific to C#: Explicit Interfaces
  • 17. Specific to C#: Explicit Interfaces01. interface Greet1 // v1.0 02. { 03. string Greet(); 04. } 05. interface Greet2 //v2.0 06. { 07. string Greet(); 08. } 09. public class Greeter : Greet1, Greet2 10. { 11. //Explicit Implementations 12. string Greet1.Greet() //Note the Visibility here 13. { 14. return “Hello from 1”; 15. } 16. string Greet2.Greet() //public not allowed for explicit 17. { 18. return “Hello from 2”; 19. } 20. public static void Main() 21. { 22. Greet1 greeter1 = new Greeter(); 23. greeter1.Greet(); // Hello from 1 24. Greet2 greeter2 = new Greeter(); 25. greeter2.Greet(); // Hello from 2 26. Greeter greeter = new Greeter(); 27. greeter. // No Greeters to Greet unless I cast 28. } 29. }
  • 18. Specific to C#: Explicit Interfaces01. interface Greet1 // v1.0 02. { 03. string Greet(); 04. } 05. interface Greet2 : Greet1 // v2.0 06. { 07. new string Greet(); 08. } 09. public class Greeter : Greet2 10. { 11. //Explicit Implementations 12. string Greet1.Greet() //Note the Visibility here 13. { 14. return “Hello from 1”; 15. } 16. string Greet2.Greet() //public not allowed for explicit 17. { 18. return “Hello from 2”; 19. } 20. public static void Main() 21. { 22. Greet1 greeter1 = new Greeter(); 23. greeter1.Greet(); // Hello from 1 24. Greet2 greeter2 = new Greeter(); 25. greeter2.Greet(); // Hello from 2 26. Greeter greeter = new Greeter(); 27. greeter. // No Greeters to Greet unless I cast 28. } 29. } 01. interface Greet1 // v1.0 02. { 03. string Greet(); 04. } 05. interface Greet2 //v2.0 06. { 07. string Greet(); 08. } 09. public class Greeter : Greet1, Greet2 10. { 11. //Explicit Implementations 12. string Greet1.Greet() //Note the Visibility here 13. { 14. return “Hello from 1”; 15. } 16. string Greet2.Greet() //public not allowed for explicit 17. { 18. return “Hello from 2”; 19. } 20. public static void Main() 21. { 22. Greet1 greeter1 = new Greeter(); 23. greeter1.Greet(); // Hello from 1 24. Greet2 greeter2 = new Greeter(); 25. greeter2.Greet(); // Hello from 2 26. Greeter greeter = new Greeter(); 27. greeter. // No Greeters to Greet unless I cast 28. } 29. }
  • 19. Specific to C#: Explicit Interfaces01. interface Greet1 // v1.0 02. { 03. string Greet(); 04. } 05. interface Greet2 : Greet1 // v2.0 06. { 07. new string Greet(); 08. } 09. public class Greeter : Greet2 10. { 11. //Explicit Implementations 12. string Greet1.Greet() //Note the Visibility here 13. { 14. return “Hello from 1”; 15. } 16. string Greet2.Greet() //public not allowed for explicit 17. { 18. return “Hello from 2”; 19. } 20. public static void Main() 21. { 22. Greet1 greeter1 = new Greeter(); 23. greeter1.Greet(); // Hello from 1 24. Greet2 greeter2 = new Greeter(); 25. greeter2.Greet(); // Hello from 2 26. Greeter greeter = new Greeter(); 27. greeter. // No Greeters to Greet unless I cast 28. } 29. } 01. interface Greet1 // v1.0 02. { 03. string Greet(); 04. } 05. interface Greet2 //v2.0 06. { 07. string Greet(); 08. } 09. public class Greeter : Greet1, Greet2 10. { 11. //Explicit Implementations 12. string Greet1.Greet() //Note the Visibility here 13. { 14. return “Hello from 1”; 15. } 16. string Greet2.Greet() //public not allowed for explicit 17. { 18. return “Hello from 2”; 19. } 20. public static void Main() 21. { 22. Greet1 greeter1 = new Greeter(); 23. greeter1.Greet(); // Hello from 1 24. Greet2 greeter2 = new Greeter(); 25. greeter2.Greet(); // Hello from 2 26. Greeter greeter = new Greeter(); 27. greeter. // No Greeters to Greet unless I cast 28. } 29. } Explicitly State the interface for which the implementation is
  • 20. Similarities • Immutable Strings • Serialization • Boxing • ConvertValue Type to a Reference Type • Unboxing • Convert Reference Type to aValue Type
  • 21. Similarities • Collections • C# - IList, IDictionary, Queue, Stack • Java - List, Map, Queue, Stack • for-each Collection Iterators
  • 22. Specific to C# • Collection Initializer • Coroutines (more precisely Generators) • yield break • yield return 01. public static void Main() { 02. foreach(int fiboSeq in new Fibonacci(5)) { 03. Console.Out.WriteLine("{0}", fiboSeq); 04. } 05. } Output: 0 1 1 2 3 5
  • 23. Specific to C# • Collection Initializer • Coroutines (more precisely Generators) • yield break • yield return 01. class Fibonacci : IEnumerable<int> { 02. private readonly int howMany; 03. private int firstSeed, secondSeed = 1; 04. 05. public Fibonacci(int howMany) 06. { 07. this.howMany = howMany; 08. } 09. 10. public IEnumerator<int> GetEnumerator() 11. { 12. if (howMany < 0) 13. { 14. yield break; 15. } 16. for (var i = 0; i <= howMany; i++) 17. { 18. yield return firstSeed; 19. var sum = firstSeed + secondSeed; 20. firstSeed = secondSeed; 21. secondSeed = sum; 22. } 23. } 24. 25. IEnumerator IEnumerable.GetEnumerator() 26. { 27. return GetEnumerator(); 28. } 29. } 01. public static void Main() { 02. foreach(int fiboSeq in new Fibonacci(5)) { 03. Console.Out.WriteLine("{0}", fiboSeq); 04. } 05. } Output: 0 1 1 2 3 5
  • 24. Covariance & Contravariance • Covariance • Pass collection of sub-class to a collection of base class • Contravariance • Pass collection of base class to a collection of sub-class • Invariance • Neither of the above applies
  • 25. Arrays and Generic Collections • Arrays are Covariant in C# and Java • There is a hole in the type system and a runtime patch is applied. • Generics are Invariant in Java. • In C#, use leniency offered by IEnumerable if you need Covariance. • Only interfaces and delegates can be covariant (out) or contravariant (in)
  • 27. C# Example 01. abstract class Animal { 02. public abstract string Speak(); 03. } 04. 05. class Cat : Animal { 06. public string Speak() { 07. return “Meow!”; 08. } 09. } 10. 11. class Dog : Animal { 12. public string Speak() { 13. return “Bark!”; 14. } 15. } 16. 17. class Printer { 18. public static Print(Animal [] animals) { 19. animals[0] = new Dog(); 20. for (var i = 0; i < animals.Length; i++) { 21. System.out.println(animals[i].speak(); 22. } 23. } 24. 25. public static Print(IList<Animal> animals) { 26. for (var animal in animals) { 27. System.out.println(animal.Speak()); 28. } 29. } 30.
  • 28. C# Example 01. abstract class Animal { 02. public abstract string Speak(); 03. } 04. 05. class Cat : Animal { 06. public string Speak() { 07. return “Meow!”; 08. } 09. } 10. 11. class Dog : Animal { 12. public string Speak() { 13. return “Bark!”; 14. } 15. } 16. 17. class Printer { 18. public static Print(Animal [] animals) { 19. animals[0] = new Dog(); 20. for (var i = 0; i < animals.Length; i++) { 21. System.out.println(animals[i].speak(); 22. } 23. } 24. 25. public static Print(IList<Animal> animals) { 26. for (var animal in animals) { 27. System.out.println(animal.Speak()); 28. } 29. } 30. 01. public static Print(IEnumerable<Animal> animals) 02. { 03. for (var animal in animals) { 04. Console.Out.WriteLine(animal.Speak()); 05. } 06. } 07. } 08. class TestCollections { 09. public static void main(String []args) { 10. Cat cat = new Cat(); 11. Animal animal = cat; 12. animal.speak(); 13. 14. animal = new Dog(); 15. animal.speak(); 16. 17. Animal [] animals = new Animal [] { cat, dog }; 18. Cat [] cats = new Cat[] { cat }; 19. animals = cats; 20. Print(animals); //Exposes Hole in Type System 21. 22. // In absence of above Print method, the code 23. // does not compile as Generic Collections in 24. // C# are Invariant. 25. List<Animal> animals = new ArrayList<Dog>(); 26 27. //We need Co-variance to allow this to compile 28. Printer.Print(dogs); 29. 30. } 31. }
  • 30. Java Example 01. abstract class Animal { 02. public abstract String speak(); 03. } 04. 05. class Cat extends Animal { 06. public String speak() { 07. return “Meow!”; 08. } 09. } 10. 11. class Dog extends Animal { 12. public String speak() { 13. return “Bark!”; 14. } 15. } 16. 17. class Printer { 18. public static print(Animal [] animals) { 19. animals[0] = new Dog(); 20. for (int i = 0; i < animals.length; i++) { 21. System.out.println(animals[i].speak(); 22. } 23. } 24. 25. public static print(List<Animal> animals) { 26. for(Animal animal : animals) { 27. System.out.println(animal.speak()); 28. } 29. } 30. }
  • 31. Java Example 01. class TestCollections { 02. public static void main(String []args) { 03. Cat cat = new Cat(); 04. Animal animal = cat; 05. animal.speak(); 06. 07. animal = new Dog(); 08. animal.speak(); 09. 10. Animal [] animals = new Animal [] { cat, dog }; 11. Cat [] cats = new Cat[] { cat }; 12. animals = cats; 13. print(animals); //Exposes Hole in Type System 14. 15. // Fails to compile as Generic Collections in 16. // Java are Invariant 17. List<Animal> animals = new ArrayList<Dog>(); 18. 19. List<Dog> dogs = new ArrayList<Dog>(); 20. dogs.add(dog); 21. dogs.add(dog); 22. print(dogs); 23. } 24. } 01. abstract class Animal { 02. public abstract String speak(); 03. } 04. 05. class Cat extends Animal { 06. public String speak() { 07. return “Meow!”; 08. } 09. } 10. 11. class Dog extends Animal { 12. public String speak() { 13. return “Bark!”; 14. } 15. } 16. 17. class Printer { 18. public static print(Animal [] animals) { 19. animals[0] = new Dog(); 20. for (int i = 0; i < animals.length; i++) { 21. System.out.println(animals[i].speak(); 22. } 23. } 24. 25. public static print(List<Animal> animals) { 26. for(Animal animal : animals) { 27. System.out.println(animal.speak()); 28. } 29. } 30. }
  • 32. Specific to C# • Anonymous Types • Anonymous Methods/Delegates • Pass Methods as Data • Action: No return values • Func: Non-void return values • Predicate: A Func that always returns a bool • Generally above suffice, but if not,then use Custom Delegates • Delegate Chaining • Compiler Eye Candy: +=, -= for Combine(), Remove() • Lambdas
  • 33. Specific to C# • Events • Syntactic sugar over delegates, but with visibility • Events can only be invoked from within the class that declared it, whereas a delegate field can be invoked by whoever has access to it. • Events can be included in interfaces, delegates cannot be. • Built-in EventHandler and EventArgs • Compiler generated add_ and remove_ methods for the event. • dynamic • ExpandoObject
  • 34. Dynamic Runtime Library CLR (Common Language Runtime) DLR (Dynamic Language Runtime) C# VB.NET Python Ruby • Allows you to talk with implementations in other languages • C#/VB.NET with Python, Ruby • Also with Silverlight etc.. Dynamically Typed Statically Typed 01. using IronPython.Hosting; 02. using Microsoft.Scripting.Hosting; 03. 04. var python = Python.CreateRuntime(); 05. dynamic script = python.UseFile(“Calculator.py”); 06. 07. // Get PythonType 08. dynamic Calculator = script.GetVariable(“Calculator”); 09. dynamic calc = Calculator(); // Instantiate Object 10. 11. //Invoke method 12. dynamic result = calc.add(2, 3); // 5
  • 35. Specific to C# • Avoid Configuration hell • Single Configuration File (App.config) • Asynchronous Programming • BeginInvoke and EndInvoke • Wait with EndInvoke • Wait with WaitHandle • Poll for Async call completion • Execute a callback upon completion • Task Parallel Library (TPL)
  • 36. Specific to Java • Static Imports • Instance and Static Initializers • Interfaces Containing Fields • Anonymous Classes • Proxy Support through Interceptor
  • 37. Specific to Java • Asynchronous Programming • Future Task • Poll Completion with isDone(). • Execute callback upon completion • Using ListenableFuture and FutureCallback - Google Guava Library • Or roll your own result completion callback. • Akka Actors
  • 38. Frameworks and Tools Java C# Dependency Injection Frameworks ORM Frameworks Proxying/AOP Frameworks TDD Frameworks Mocking Frameworks BDD Frameworks Build Tools Coverage Tools Profiler Code Analysis Tools Spring, Guice, Pico Container etc... Spring.NET, Unity Container Hibernate, iBatis etc... NHibernate, Entity Framework JDK Proxy, Spring AOP, CGLib AspectJ, AspectWerkz Castle Proxy, Rhino Proxy, Unity Interceptor JUnit, TestNG NUnit, MSTest JMock2, Mockito, EasyMock Rhino Mocks, Moq, TypeMock Cucumber, JBehave, Spock, Easyb NBehave, SpecFlow, NSpec Ant, Maven, Gradle, Ivy NAnt, MSBuild, NMaven Cobertura, Emma, Clover NCover, OpenCover JProfiler, YourKit dotTrace, YourKit.NET FindBugs, PMD, Checkstyle, JDepend FxCop, NDepend, ReSharper, Simian
  • 39. References • MSDN Site • Venkat Subramaniam • http://agiledeveloper.com/presentations/CSharpForJavaProgrammers.zip • Wikipedia • http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java • Dare Obasanjo • http://www.25hoursaday.com/CsharpVsJava.html • Scott Hanselman • http://www.hanselman.com/blog/ C4AndTheDynamicKeywordWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx