Chapter 3
Identifiers and Interfaces

   3.1 Names of Entities
   3.2 Paths to Identifiers
   3.3 Fields
   3.4 Methods
   3.5 Constructors
   3.6 Signatures
   3.7 Types
   3.8 Modifiers
   3.9 Instance and Class Features
   3.10 Parameters
   3.11 Assignment #3: Interfaces

3.1 Names of Entities

3.2 Paths to Identifiers

3.3 Fields

The interface of a field includes

Field Summary
staticdoubleEMath
staticdoublePIMath
modifierstypename 
doublefoo[]
double []woo

3.4 Methods

The interface of a method includes

Method Summary
staticdoublerandom ()Math
staticdoublesqrt(double a)Math
Stringconcat(String str) String
Stringsubstring(int beginIndex) String
Stringsubstring(int beginIndex, int endIndex) String
public staticvoidmain(String [] args)  
modifiersreturn typenameparameters 
Consecutive parameters are separated by a comma.

3.5 Constructors

The interface of a constructor includes

Constructor Summary
String() String
String(char[] value) String
modifiersnameparameters 

3.6 Signatures

The signature, of a method or a constructor, is a sub-portion of the interface consisting of

Signatures
substring (int beginIndex) String
substring(int beginIndex, int endIndex)String
String () String
String(String original) String
String (char[] value) String

3.7 Types

Types may be

static double random() Math
String substring (int beginIndex)String
static void exit(int status)System
String (char[] value)String
static double PI Math

3.8 Modifiers

abstract, final, interface, native, private, protected, public, static, strict, synchronized, transient, volatile.

3.9 Instance and Class Features

Classes have two types of features:

3.10 Parameters

Each parameter consists of

In some contexts, the names of parameters are of no interest.

3.11 Assignment #3: Interfaces

Due: Mon, Apr 7, at class

Consider the following list of interfaces.

  1. A a
  2. B a()
  3. a()
  4. a(int [] b)
  5. a(int b)
  6. int a
  7. int a()
  8. static double a(int [] b)
  9. static int a
  10. static int a(int b)
Answer the following questions for the above given list of interfaces.

  1. Which entries can stand for a field.
  2. Which entries can stand for a method? What are their signatures?
  3. Which entries can stand for a constructor? What are their signatures?
  4. What are the primitive data types in use.
  5. What are the class data types in use.
  6. Which of the features are class features? instance features?
Please submit your answers on paper.

Q&A