1.学生类的使用:
class hello2 { public static void main(string[] args) { student s = new student(); s.name = "王哥"; s.age = 25; s.gender = "男"; system.out.println(s.name + "..." + s.age + "..." + s.gender); s.study(); s.sleep(); } } class student { string name; int age; string gender; public void study() { system.out.println("学生学习"); } public void sleep() { system.out.println("学生睡觉"); } }
结果:
2.手机类的使用:
class hello2 { public static void main(string[] args) { phone s = new phone(); s.brand = "华为"; s.price = 2000; system.out.println(s.brand + "..." + s.price); s.call(); s.sendmessage(); s.playgame(); } } class phone { string brand; int price; public void call() { system.out.println("打电话"); } public void sendmessage() { system.out.println("发信息"); } public void playgame() { system.out.println("玩游戏"); } }
结果:
如对本文有疑问, 点击进行留言回复!!
利用python将Mysql信息以Excel文件并作为邮件附件发送
springmvc+mybaits+mysql上传表情Incorrect string value: ‘\xF0\x9F\xA4\xB4\xF0\x9F...‘ for
SpringCloud Greenwich集成Seata1.2.0详解说明(原创by ulwfcyvi)
mybatis generator生成代码库 与指定的库不一致 为其他库的同名表
网友评论