标签:course ret 特点 col system 思路 小白 ola ons
1.进度:java学习了类的继承,继承的特点,关键词super,extends(java不能多继承,但可以多层继承)
package teacher;
public class teacher_ {
public static void main(String[] args){
Teacher t=new Teacher("小白",20,‘女‘,"高级","生物","二班");
t.eat();
t.sleep();
t.teach();
System.out.println("---------------");
Student s=new Student("小红",19,‘女‘,"生物",5,"二班");
s.eat();
s.sleep();
s.attend();
/**Person p=new Person();
p.setName("小红");
p.setAge(15);
p.setGender(‘女‘);
p.setCourse("数学");
p.eat();
p.sleep();*/
}
}
class Person{
private String name;
private int age;
private char gender;
private String course;
public Person(){}
public Person(String name,int age,char gender,String course){
this.name=name;
this.age=age;
this.gender=gender;
this.course=course;
}
public void eat(){
System.out.println(name+"在吃饭");
}
public void sleep(){
System.out.println(name+"在睡觉");
}
public String getName(){
return name;
}
public void setName(String name){
this.name=name;
}
public int getAge(){
return age;
}
public void setAge(int age){
this.age=age;
}
public char getGender(){
return gender;
}
public void setGender(char gender){
this.gender=gender;
}
public String getCourse(){
return course;
}
public void setCourse(String course){
this.course=course;
}
}
class Teacher extends Person{
private String title;
private String className;
public Teacher(){}
public Teacher(String name,int age,char gender,String course,String title,String className){
super(name,age,gender,course);
this.title=title;
this.className=className;
}
public void teach(){
System.out.println(getName()+"在讲课");
}
public String getTitle(){
return title;
}
public void setTitle(String title){
this.title=title;
}
public String getClassName(String className){
return className;
}
public void setClassName(){
this.className=className;
}
}
class Student extends Person{
private int ranking;
private String classNumber;
public Student(){}
public Student(String name,int age,char gender,String course,int ranking,String classNumber){
super(name,age,gender,course);
this.ranking=ranking;
this.classNumber=classNumber;
}
public void attend(){
System.out.println(getName()+"在听课");
}
public int getRanking(){
return ranking;
}
public void setRanking(int rank){
this.ranking=ranking;
}
public String getClassNumber(String classNumber){
return classNumber;
}
public void setClassNumber(){
this.classNumber=classNumber;
}
}
2.学习了CSS类别器选择,不同的声明,文体的字体,背景和超链接,并且简单的实现了背景的添加。
并在上周的基础上简单的增添了背景图片。
<html>
<head>
<title>超链接</title>
<style>
a:link{
text-decoration:none;
color:red;
}
a:hover
{
text-decoration:underline;
color:blue;
}
a:visited{
color:green;
text-decoration:none;
}
</style>
</head>
<body>
<a href="http://www.baidu.com">我是一个超链接</a>
</body>
</html>
2.计划:继续学习java类的抽象类和最终类,并开始下一章的学习。
3.问题:在网站上学习的java的比较片面,实际操作不上手,错误百出。还有html分批收获学习进步比较大,但是总的来说将学习的知识结合起来,制作东西,头脑就比较乱,没有逻辑思路,以后需要更多的锻炼机会,多做实践,制作东西,将自己学习的东西用实际呈现出来。
4.学习时长:每天3个小时,用于编程的一个多小时。
标签:course ret 特点 col system 思路 小白 ola ons
原文地址:https://www.cnblogs.com/hhjing/p/11256139.html