Specifications

Sun Services
Java™ Programming Language
Module 2, slide 9 of 26
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Declaring Attributes
Basic syntax of an attribute:
<modifier>* <type> <name> [
=
<initial_value>]
;
Examples:
1 public class Foo {
2 private int x;
3 private float y = 10000.0F;
4 private String name = "Bates Motel";
5}