总是搞不清的参数问题

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图

package sunday;

import java.util.Scanner;

class Person{

String name;
int age;
String work;
static String nation="中国";
public Person(String name,int age,String work,String nation){
    this.name=name;
    this.age=age;
    this.work=work;

}
public void Display(){
    System.out.println(" 姓名:"+name+"------"+"年龄:"+age+"------"+"职业:"+work+"------"+"国籍:"+nation);
}

}
public class test1 {
public static void main(String[] args) {
int i=1;
while (i<= 2){
Scanner sc=new Scanner(System.in);
String name=sc.next();
int age=sc.nextInt();
String work=sc.next();
String nation=sc.next();
}
Person p1=new Person(name,age,work,nation);
p1.Display();

}

}

运行结果及报错内容

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
name cannot be resolved to a variable
age cannot be resolved to a variable
work cannot be resolved to a variable
nation cannot be resolved to a variable

我的解答思路和尝试过的方法
我想要达到的结果

把Person p1=new Person(name,age,work,nation);,放上面大括号上面,望采纳

img