`
文章列表
1.定义一个可观察者WeatherData,继承了java.util.Observable类 package pattern.javaObserver; import java.util.Observable; public class WeatherData extends Observable{ private float temperature; private float humidity; private float pressure; public void measuarementsChanged(){ setChanged(); n ...
<html> <head> <title>textarea赋值</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script> <script type="text/j ...
$(function(){ $(window).scroll(function () { if ($(this).scrollTop() > 500) { $('#toTop').fadeIn(); } else { $('#toTop').fadeOut(); } }); $("#toTop").click(function(){ $("html,body").animate({scrollT ...
/* * czl 插入排序 */ public class InsertSort { public static void main(String[] args){ int[] a = {5,1,4,2,6,1,4,22,3,23,12,43,2}; int temp,j; for(int i=1;i<a.length ;i++){ j=i; temp = a[j]; while(j>0&&a[j-1]>temp){ a[j] = a[j-1]; j--; } ...
/* * czl 选择排序 */ public class selectSort{ public static void main(String[] args){ int[] a = {1,5,3,2,1}; int minIndex ; int temp; for(int i=0;i<a.length;i++){ minIndex=i; for(int j=i+1;j<a.length;j++){ if(a[j]<a[minIndex]){ minIndex= j; } } ...
public class maopaosort { /** * @param chenzeliang 冒泡排序 */ public static void main(String[] args) { int[] a = new int[5]; for(int k=0;k<a.length;k++){ a[k] = (int)(Math.random()*10); System.out.print(a[k]+" "); } int temp; for(int i=0;i<a.length-1;i+ ...
Global site tag (gtag.js) - Google Analytics