Home  >  Q&A  >  body text

java - 如何将一个私有变量在另一个类中进行接收??

天蓬老师天蓬老师2743 days ago449

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:52:49

    penguin.setHealth(input.nextInt())

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:52:49

    The set method is a return value of void type. The penguin.setHealth() method will not return a field. How can it perform an assignment operation?

    reply
    0
  • Cancelreply