源码如下:
class Person{
String name;
int age,grade;
void skill(String s){
grade = 4;
System.out.println(s);
}
}
public class JoinMaker{
public static void main(String args[]){
Person myself = new Person();
myself.name = "Jerry";
myself.age = 23;
myself.grade = 4;
System.out.println("The man who want to join Maker is " + myself.name + ", now he is " +
myself.age + " years old and he is in grade " + myself.grade);
myself.skill("I hava many skills,such as Computer Repairing、Play Basketball、Playing the
guitar and so on!");
switch(myself.grade){
case 1:System.out.println("Great!Freshman!Let's begin,you will have a wonderful
future!");
case 2:System.out.println("Well done!You are smart and fit 2be next Zuckerberg!");
case 3:System.out.println("Good job,guy!You are futherlooker!");
case 4:System.out.println("Congratulations!Though you are going to left your study
from HighSchool,we wanner you to be one of us.Let's work together!");
break;
default:System.out.println("Though you are no the most suitest time to join us,but
we welcome anytime.Let's make our future brightful!"); break; } } } 想将switch放进构造函数中,变量如何传递,求大神帮助!!!还有java的学习方向,本人迷茫中,求助......