摘要: 1、Java中做输入的方式:通过控制台输入数据,需要使用Scanner对象来操作,如下:Scanner sc = new Scanner(System.in);int a = sc.nextInt();System.out.println(a);输入什么,就输出什么。 阅读全文
posted @ 2015-11-17 21:58 xiaolongecom 阅读(135) 评论(0) 推荐(0)
摘要: 斐波那契数列的实现package DiGuistyle;import java.util.Scanner;public class DiGuiZuoYe {/* * 用递归实现斐波那契数列 1、1、2、3、5、8、13、21、.... * * F(1)=1;F(2)=1; * F(N)=F(... 阅读全文
posted @ 2015-11-17 20:49 xiaolongecom 阅读(280) 评论(0) 推荐(0)
摘要: 代码如下package DiGuistyle;public class digui { // 非递归方法 // 设置static静态方法 可以用digui.notDiGui()类的形态调用方法 static long notDiGui(int n){ long res... 阅读全文
posted @ 2015-11-17 17:36 xiaolongecom 阅读(243) 评论(0) 推荐(0)
摘要: package cep10;public class Static1 { void fun1(){ System.out.println("这是一个普通方法"); } static void fun2(){ System.out.println(... 阅读全文
posted @ 2015-11-15 21:49 xiaolongecom 阅读(427) 评论(0) 推荐(0)
摘要: package cp03.se03_peopleLei;public class exp01 { // 返回类型 return 对应 int int speak(String name,int age,String ...aihaomen){ System.out.prin... 阅读全文
posted @ 2015-11-14 17:06 xiaolongecom 阅读(168) 评论(0) 推荐(0)
摘要: /*** Java中的return语句使用总结*/public class TestReturn {public static void main(String args[]) { TestReturn t = new TestReturn(); t.test1(); ... 阅读全文
posted @ 2015-11-14 16:32 xiaolongecom 阅读(192) 评论(0) 推荐(0)
摘要: package com.lhzh.cp07;public class ShuZuDEL0 { public static void main(String[] args) { int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5}; ... 阅读全文
posted @ 2015-11-14 09:15 xiaolongecom 阅读(499) 评论(0) 推荐(0)