IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesJava  Print This     

Partial Class (Java and C# Cross Reference Guide)

By Mike Prestwood

Java versus C#: A side by side comparison between Java and C#.

 
OOP Details
 

More object oriented (OO) stuff.

Partial Class

[Other Languages] 

A partial class, or partial type, is a class that can be split into two or more source code files and/or two or more locations within the same source file. Each partial class is known as a class part or just a part. Logically, partial classes do not make any difference to the compiler. The compiler puts the class together at compile time and treats the final class or type as a single entity exactly the same as if all the source code was in a single location.

Languages Focus

For languages that have implemented partial classes, you need to know usage details and restrictions. Can you split a class into two or more files? Can you split a class within a source code file into two or more locations? What are the details of inheritance? Does it apply to interfaces as well?

Java:  "Partial Classes" Not Supported
C#:  "Partial Classes" partial

C# uses the keyword partial to specify a partial class. All parts must be in the same namespace.

Syntax Example:
class partial Cyborg: System.Object
{
}












Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]