Using classes , parametars, objects with Scanner input : I have a class City.java and State.java with automatically generated constructors, getters and setters(if needed i can reupload the question with them ).In Main.java my task is to get informations with Scanner as input and make objects when all the informations are written in.
Data input for each object is needed to be taken out in separate methods that will be eventually called from main method . Each of these methods must return the object that fills . Its allowed to only one object of class Scenner .

  

 
    public Class City { 
     private String name;
     private Bigdecimal surface;
     //+constructor , + getters and setters
     }
    public Class State {
    private String name;
    private City city;
     //+constructor , + getters and setters
    }

    public class Main {
      
        public static City city (Scanner scanner) {
        System.out.println("Store City name : ");
        String cityName = scanner.nextLine();
        System.out.println("Store City surface : ");
        BigDecimal citySurface = scanner.nextBigDecimal();

        return new City(cityName,citySurface);
    }

    public static State state (Scanner scanner){
      System.out.println("Store State name : ");
      String stateName = scanner.nextLine();
      ***********************
      Im lost at this point , the task is that i should return new 
      State with parametars (stateName,City) but cant figure it out
      how to pass previously entered City here as a parametar.
      ***********************

    }
      public static void main(String[] args) {
      Scanner mainScanner = new Scanner (System.in);
         }
    
      }


 







