Method declaration
{MethodModifier}
stactic
MethodHeader
Result
float
MethodDeclarator
Identifier
IdentifierChars
JavaLetter
“m”
{JavaLetterOrDigit}
“i"
“n”
([FormalParameterList])
FormalParameters
FormalParameter
UnannType
Subtopic
int []
VariableDeclaratorId
Identifier
... "a"
MethodBody
{ // TODO: implements this }
Task 2
Task 3
Method Declaration
Method Modifier
Static
Method Header
Result
int
Method Declarator
Identifier
Identifier chars
Java letter
nextCount
Formal Parameter List
Formal Parameters
UnannType
UnannPrimitiveType
Numberic Type
int
Variable Declarator
Identifier
i
Method Body
Block
Local Variable Declaration Statement
Local Variable Declarationbtopic
UnannType
Uann Peimitive Type
Numberic Type
int
Variable Declarator
Identifier
j
Variable Declarator List
Variable Declarator
Variable Declaratorld
j
Variable Intializer
i+1
Statement
Statement Without Trailing Substatement
Return Statement
return j
Task 4
Method Declaration
Method Modifier
Private static
Method Header
result
float
Method Declarator
Identifier
Identifier Chars
Java Letter
'm'
Java Letter Or Digis
'i','n'
Formal Parameter List
Formal Parameters
Formal Parameter
UnnaType
UnannPrimitiveType
NumbericType
float
Identifier
'a'
Formal Parameter
UnnaType
UnannPrimitiveType
NumbericType
float
Identifier
'b'
Method Body
Block
LocalVariableDeclarationStatement
LocalVariableDeclaration
UnnaType
NumbericType
float
VariableDeclarator
identifier
min
Statement
ConditionalExpression
ConditionalOrExpression
a<=b
Expression
?a
ConditionalExpression
:b
StatementWithoutTrailingSubstatement
ReturnStatement
return min
Task 5
MethodDeclaration
MethodModifier
Private static
Method Header
result
float
Method Declarator
Identifier
Identifier Chars
Java Letter
'm'
Java Letter Or Digis
'i','n'
Formal Parameter List
Formal Parameters
Formal Parameter
UnnaType
UnannPrimitiveType
NumbericType
float
Identifier
'a'
Formal Parameter
UnnaType
UnannPrimitiveType
NumbericType
float
Identifier
'b'
MethodBody
Block
LocalVariableDeclarationStatement
LocalVariableDeclaration
UnnaType
UnannPrimitiveType
NumbericType
float
VariableDeclarator
identifier
min
Statement
IfThenElseNoShortIfStatement
Expression
a<=b
StatementNoshortIf
min =a
StatementNoshortIf
min=b
StattementWithoutTrailingSubstatement
ReturnStatement
return min
return min
Task 6
MethodDeclaration
MethodModifier
static
MethodHeader
Result
int
MethodDeclarator
Identifier
JavaLetters
Javaletter
search
FormalParameterList
FomalParameters
FormalParameter
UnannType
UnannReferenceTypr
UnannArrayTyoe
UnannPrimitiveTypeDIms
int[]
Iderntifier
a
FormalParameter
UnnaType
UnannPrimitiveType
NumbericType
int
Identifier
x
MethodBody
Statement
ForStatementNoShortIf
BasicForStatementNoShortIf
Forlnit
LocalVariableDeclaration
UnannType
UnannPrimitiveType
NumbericType
int
VariableDeclarator
VariableDeclaratorld
i
VariableInitializer
0
Expression
RelationalExperssion
i<a.length
ForUpdate
StatementExpressionList
StatementExpression
UnaryStatement
i++
Block
IfThenStatement
Expression
RelationalExpression
x == a[i+0]
Statement
StatementWithoutTrailingSubstatement
ReturnStatement
return i
StattementWithoutTrailingSubstatement
ReturnStatement
return -1
Task 7
MethodDeclaration
MethodModifier
Public static
MethodHeader
Result
void
MethodDeclarator
Identifier
main
FormalparameterList
FormalP
UnannType
UnannRefenrenceType
UnannArrayType
UnannTypeVariable Dims
String[]
VariableDeclaratorld
args
MethodBody
Block
LocalVariableDeclarationStatement
VariableDeclaration
UnannType
UnannReferenceType
UnannArrayType
int[]
VariableDeclaratorList
VariableDeclarator
VariableDeclaratorld
a
VariableInitializer
{1, 1, 2, 3, 5, 8, 13}
VariableDeclaration
UnannType
UnannPrimitiveType
NumbericType
int
VariableDeclaratorList
VariableDeclarator
VariableDeclaratorld
a
VariableInitializer
TextIo.getInt()
VariableDeclaration
Subtopic
Subtopic
Subtopic
Subtopic
VariableDeclaratorList
VariableDeclarator
VariableDeclaratorld
a
VariableInitializer
search(a,x)
Statement
StatementWothoutTrailingSubStatement
ExpressionSatement
System.out.printf("%d is in %s at %d", x, a, isAt);