package com.swift; public class Phone { private String pinpai; private int dianliang; public String getPinpai() { return pinpai; } public void setPinpai(String pinpai) { this.pinpai = pinpai; } public int getDianliang() { return dianliang; } public void setDianliang(int dianliang) { this.dianliang = dianliang; } public void checkPower() { if(this.getDianliang()<20) { System.out.println("电量过低,请充电"); } } }
转载自原文链接, 如需删除请联系管理员。
原文链接:黑马基础阶段测试题:创建Phone(手机)类,Phone类中包含以下内容:,转载请注明来源!
相关推荐