As you are reading from excel, all the values may be in String, unless you are converting that to an Integer.
In your test, argument age to be used as an Integer.
Changing type to String should resolve the issue
@Test(
dataProvider = "newdata")
public void testData(String username, String password, String age) { System.out.println(username + " - " + password + " - " + age); }
The following code would raise the same error.
@DataProvider(name = "newdata")
public static Object[][] getData() { return new Object[][]{ {"20"}, {"30"} }; }
@Test(dataProvider = "newdata")
public void testData(Integer age) { System.out.println(age); }
For more information, check out this selenium tutorial.
This Intellipaat's automation testing course will give you an introduction to software testing.