Java Programming for C# Developers

This course helps C# developers get up to speed quickly with the Java programming language and the Java Standard Edition (SE) 7 development platform. The course focuses on the differences between the C# and Java languages, and also explains how the .NET Framework library maps to the Java SDK.

Duration

4 days

 

Prerequisites

  • At least 6 months programming experience, ideally in C#

What you'll learn

  • Understanding core differences between Java and C++
  • Defining and using classes
  • Using arrays, collections, and generics
  • Implementing inheritance and polymorphism
  • Working with exceptions
  • Multithreading
  • Using common Java APIs and techniques

Course details

Getting Started with Java

  • Compiling and running Java applications
  • JVM options
  • JAR files vs. .NET assemblies
  • Understanding Ant and Maven
  • Where to get more information about Java in online communities
  • Common open-source libraries

Core Language Differences between C# and Java

  • Primitive types in Java vs. struct types in C#
  • Packages vs namespaces
  • Miscellaneous language differences

Defining and Using Classes

  • Classes in Java
  • Differences in how to declare data members and member functions
  • Differences in initialization and construction
  • Parameter passing modes in Java vs. C#

Arrays

  • Declaring and using arrays
  • Traversing arrays
  • Using the Arrays class
  • Multi-dimensional arrays

Inheritance and Interfaces

  • Things you can do in C# that you can't do in Java
  • Things you can do in Java that you can't do in C#
  • Miscellaneous language differences

Collections and Generics

  • Overview of collections and generics
  • Using Java collection classes vs. .NET collection classes
  • Defining generic classes and generic methods vs. C# generics
  • Java generic specifiers

Exceptions and Assertions

  • Overview of exception handling
  • Throwing and catching exceptions
  • Standard exception classes
  • Defining new exception classes
  • Working with assertions

Going Further with the Java Language

  • Autoboxing and unboxing
  • Varargs
  • Type-safe enumerations
  • Static imports

Inner Classes

  • Overview of inner classes
  • Regular inner classes
  • Method-local inner classes
  • Anonymous inner classes vs. C# delegates
  • Static nested classes

Multithreading

  • Creating multiple threads
  • Synchronizing threads
  • Synchronization classes
  • Concurrency API

Additional Multithreading Issues

  • Using concurrent collections
  • Using synchronizers and locks
  • Thread pooling techniques
  • Using the executor framework
  • Using pooling effectively

Common Java APIs

  • Reading and writing files
  • Accessing databases using JDBC
  • Calling Web Service

Reflection

  • Dynamic retrieval of information using reflection
  • Creating instances of extensibility objects
  • Class fields, methods and constructors

Tuning Garbage Collection

  • Essential concepts
  • Understanding object lifetimes
  • Generational collectors
  • Heap organization
  • Garbage collection options
  • Garbage collection monitoring and tuning