java:Student类
package collection;
public class Student {
public Student() {}
public Student(String name, String sex, int age) {
this.name = name;
this.sex = sex;
this.age = age;
}
@Override
public String toString() {
return "Student [toString()=" + this.name+"-->"+ this.sex +"-->"+ this.age + "]";
}
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
private String sex;
private int age;
}
相关文档:
为什么说乱码是中国程序员无法避免的话题呢?这个首先要从编码机制上说起,大家都是中文和英文的编码格式不是一样,解码也是不一样的!如果中国的程序员不会遇到乱码,那么只有使用汉语编程。汉语编程是怎么回事我也不大清楚,应该是前年吧,我一朋友给我介绍汉语编程,怎么不错不错?当时因为学习忙没去关注这个,等我闲 ......
(一)线程同步
实现生产者消费者问题来说明线程问题,举例如下所示:
/**
* 生产者消费者问题
*/
public class ProducerConsumer {
/**
* 主方法
*/
public static void main(String[] args) {
ProductBox pb = new ProductBox ......
public class Split{
public static void main(String[] args){
double pai = 3.14159;
findTwo(pai);
public static void findTwo(double value){
System.out.println(new DecimalFormat("0.##"). ......
package arrays.compara;
import java.util.Arrays;
public class Student {
public static void main(String[] args) {
Stu[] stus = new Stu[]{
new Stu(156,34,"ad"),
new Stu(153,24,"cc"),
new Stu(126,37,"ab"),
......
package arrays.myArray;
public class SortArr {
public static void main(String[] args) {
int[] arrInt = { 4, 7, 8, 5, 6, 3, 2, 3, 4 };
maoPaoSort(arrInt);
print("冒泡排序:", arrInt);
arrInt = new int[]{ 4, 7, 8, 5, 6, 3, 2, 3, 4 };
& ......