Lecture 3 SE
Lecture 3 SE
Lecture 3 SE
• The statement
static int x;
declares x to be a static variable of the type int
• Static variables declared within a block are
local to the block
−Their scope is the same as any other local
identifier of that block
• Syntax error:
• Assume:
− a, b are int, ch is char, d is double
• Examples of legal calls:
• length
• size
• find
• substr
• swap