Please see below code:
//Create Spark Context SparkConf sparkConf = new SparkConf().setAppName(\"TestWithObjects\").setMaster(\"local\"); JavaSpa
A DataFrame is stored as Rows, so you can use the methods there to cast from untyped to typed. Take a look at the get methods.
DataFrame
Row
get