码迷,mamicode.com
首页 > 其他好文 > 详细

小猫取经2017-06-23

时间:2017-06-26 21:20:54      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:port   string   ring   imp   tin   否则   out   cal   rgs   

package Java.Test;

import java.util.Calendar;

public class Lianxi {

public static void main(String[] args) {
String months[]={"Jan","Feb","Mar","Apr","May","Jun","July","Aug","Sep","Oct","Nov","Dec"};
Calendar cal=Calendar.getInstance();
//System.out.print("Date:");
System.out.print(months[cal.get(Calendar.MONTH)]);
System.out.print("/"+cal.get(Calendar.DATE)+"/");
System.out.print(cal.get(Calendar.YEAR)+",");
double a=Math.random();
int b=(int)(a*10+3);
System.out.print(b);
Cat c=new Cat("克的黄色波斯猫出生了",200.2);
c.Cat1("田帅");
System.out.print("从此它就快乐的生活了,");
Cat I=new Im();
Im I1=(Im)I;
I1.i();
Cat O=new Owener();
Owener O1=(Owener)O;
O1.owner();
}
}
class Cat{
String str;
int age;
double weight;
String name;
Cat(){

}

Cat(String str,double weight){
System.out.print("只体重"+weight+str+",");
}
void Cat1(String name){
System.out.print("主人赐予它"+name+"的大名,");
}
}
class Owener extends Cat{
void owner(){
System.out.println("指点了它,给它讲述了它来到这个世界的目的,它是带着远大的使命来帮人类渡劫的,它听了之后,似乎一夜之间长大了,第二天它就向主人辞行,");
System.out.print("踏上了去往印度取经的道路,一路上它经历各种坎坷,翻山越岭,在来到到达目的地之前的最后一个国度(女儿国)时,");
System.out.println("它沦陷了,它被美色所迷惑,");
System.out.print("忘记了自己的使命,纸醉金迷,在它临行前,高人指点过它,切不可耽误行程,否则它将灰飞烟灭,沉迷三月之后,它终被自己的贪婪至于万劫不复!");
}
void owner2(){

}
}
class Im extends Cat{
void i(){
System.out.println("等到它过百天的时候,来了一位世外高人,");

}
}

小猫取经2017-06-23

标签:port   string   ring   imp   tin   否则   out   cal   rgs   

原文地址:http://www.cnblogs.com/wgb190/p/7082088.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!