1. 以下程序的输出结果为_____________。int a[] = {1, 2, 3, 4, 5, 6 };for (int i = a.length - 1; i >= 0; i--)System.out.print(a[i] + "");
public class Person {String name;int age;public Person(String name, int age) {this.name = name;this.age = age;}public static void main(String[] args) {Person c = new Person("zhangsan", 20);System.out.println(c.name + " is " + c.age + " years old!");}}
public class Course {private String cNumber;private String cName;private int cUnit;public Course(String number, String name, int unit) {cNumber = number;cName = name;cUnit = unit;}public void printCourseInfo() {System.out.println("课程号:" + cNumber + "课程名:" + cName + "学分:" + cUnit);}}public class CourseTest {public static void main(String args[]){Course c;c = new Course("101", "JAVA程序设计", 3);c.printCourseInfo();}}
public class Tom {private float weight;private static String name;public void setWeight(float weight) {this.weight = weight;}private void out() {System.out.println(name + "体重:" + weight + "斤");}public static void main(String[] args) {Tom.name = "kitty";Tom cat = new Tom();cat.setWeight(10);cat.out();}}