the class is the same.

but there are two methods:

first method:
if simply returns a string.

public String FindPiece(String chessPiece) {
		return name;

name. is a constructor variable. it is a name of the chess piece

public Pawn(String name){;

second method
public boolean isMoveValid(ChessPiece[][] pieces, int columnStart, int rowStart, int columnEnd, int rowEnd) {

if( columnEnd==rowEnd && (pieces[rowStart][columnStart].FindPiece(chessPiece).charAt(0)!=pieces[rowStart+1][columnStart-1].FindPiece(chessPiece).charAt(0)) || pieces[rowStart][columnStart].FindPiece(chessPiece).charAt(0)!=pieces[rowStart+1][columnStart+1].FindPiece(chessPiece).charAt(0) || (pieces[rowStart][columnStart].FindPiece(chessPiece).charAt(0)!=pieces[rowStart-1][columnStart-1].FindPiece(chessPiece).charAt(0) || pieces[rowStart][columnStart].FindPiece(chessPiece).charAt(0)!=pieces[rowStart-1][columnStart+1].FindPiece(chessPiece).charAt(0))){


as you can see in the condition. the FindPiece method is inside the "isMoveValid" method.

is that legal?

You can call methods from inside other methods.

No it is not inside it. What is done you call FindPiece. You can call it from wherever you want. So you are calling it from inside the method. You can call methods inside other methods:

public void p1() {

public void p2() {
public void p3() {

What is done, the ChessPiece [][] pieces is an array, the pieces[][] is a ChessPiece. So you can call its method:
And since it returns a String then this is a String:
So you can do this:

alright, thats good to know. thank you guys.. i was worried i made a mistake