Hey Yuvraj, we can create a Data Driven Framework by using @DataProvider annotation in TestNG.
@DataProvider(name="getData")
public Object[][] getData(){
//Object [][] data = new Object [rowCount][colCount];
Object [][] data = new Object [2][2];
data [0][0] = "FirstId";
data [0][1] = "FirstPswd";
data[1][0] = "SecondId";
data[1][1] = "SecondPswd";
return data;
}