您的意思是我不能使用这种方式,那么我如何使用2,3等...在一个公共类中获取并设置? [英] you mean that i cannnot use this way ,then how i can use 2 , 3,... get and set in a one public class?

查看:61
本文介绍了您的意思是我不能使用这种方式,那么我如何使用2,3等...在一个公共类中获取并设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

package employee;
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {
    Scanner input=new Scanner(System.in);
    employeetest myemployeetest = new employeetest();
    System.out.printf("initial hourPay is :%s\n\n",myemployeetest.gethourPay());
    System.out.println("please enter the hourPay:");
    String thePay = input.nextLine();
   employeetest.setemployeetest(thePay);
    System.out.println();
  myemployeetest.displaymessage();
    }
    public static void employeename(String[]args)
    {
        Scanner input = new Scanner(System.in);
        employeename myemployeename = new employeename();
        System.out.printf("please enter employeename: %s\n\n",myemployeename.getemployeename());
        String thename = input.nextLine();
        myemployeename.setemployeeName(thename);
        System.out.println();
        myemployeename.displaymessage();
    }
}





is it true?can i do this work?

推荐答案

mf_arian写道:
mf_arian wrote:

是真的吗?



似乎没有,我建议您花更多时间在教程 [ ^ ].



It would appear not, I suggest you spend some more time with the tutorials[^].


这篇关于您的意思是我不能使用这种方式,那么我如何使用2,3等...在一个公共类中获取并设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆