Both Java and C# are strongly typed languages, meaning variables must be declared with a specific type before they are used and can hold only values compatible with that declared type. Both Java and C# define seven types of variables. Despite this coincidence, significant differences exist in how each language categorizes its variable types, as described in Table 5-20.
Table 5-20. A Comparison of Variable Types in Java and C#
Fields declared using the static modifier. In Java, this also includes any fields declared in interfaces. Refer to the Members section earlier in this chapter for full details.
Fields declared as members of a class (or struct in C#) that are ...