the code below demonstates the principle of the'recursive-call' that the programing beginner may be confused with,and each demonstrate was followed by a screenshot:

the first part of the code called in the main:

 String s2 = toBinary2(6, sb);

the actual code:

 static String toBinary2(long n, StringBuilder sb)
{
if(n > 0)
{
toBinary2(n / 2, sb);
sb.append(n % 2);
}
return sb.toString();
}

the relevant screenshot:

figure 01 - to binary

the second part of the code called in the main:

 int sum = sum(100000);

the actual code:

 static int sum(int num)
{
if(num == 1)
return 1;
return num + sum(num - 1);
}

the correspond screenshot:

recursive - simple screenshot but detail principle.的更多相关文章

  1. Simple screenshot that explains the singleton invocation.

    Here is the code: /* Some class,such as a config file,need to be only one.So we need to control the ...

  2. Simple screenshot that explains the non-static invocation.

    Here is the code: /* Instance invocation in the memory: */ package kju.obj; import static kju.print. ...

  3. Why AlloyFinger is so much smaller than hammerjs?

    AlloyFinger is the mobile web gesture solution at present inside my company, major projects are in u ...

  4. Pyhton开源框架(加强版)

    info:Djangourl:https://www.oschina.net/p/djangodetail: Django 是 Python 编程语言驱动的一个开源模型-视图-控制器(MVC)风格的 ...

  5. Python开源框架

    info:更多Django信息url:https://www.oschina.net/p/djangodetail: Django 是 Python 编程语言驱动的一个开源模型-视图-控制器(MVC) ...

  6. 一次日语翻译的Chrome插件开发经历

    序言 去年7月刚过了日语N2,想着今年考个N1,为了加深日语文化的了解,还有学习日语,平时免不了经常上日语网站. 但是毕竟水平有限,所以不免遇到不认识的单词,日语单词的一个特点就是很多单词你知道是什么 ...

  7. Android设计和开发系列第一篇:Notifications通知(Design)

    Design篇 Notifications The notification system allows users to keep informed about relevant and timel ...

  8. 整理 Xamarin.Forms - Plugins

    Open Source Components for Xamarin Xamarin官方整理的一些开源组件,有需要可以先到这里找 GitHub: xamarin/XamarinComponents: ...

  9. Plastic Sprayers Manufacturer - Ingenious Design Of Spray Plastic Bottle

    Plastic bottles are now an indispensable container in life. Plastic bottles will appear in all aspec ...

随机推荐

  1. Django Sqlite3 数据库向MySQL迁移

    整合了两个URL而来.. 1,http://www.phodal.com/blog/django-mezzanine-sqlite3-migrate-mysql/ 2,http://www.ziqia ...

  2. 报表中的Excel操作之Aspose.Cells(Excel模板)

    原文:报表中的Excel操作之Aspose.Cells(Excel模板) 本篇中将简单记录下Aspose.Cells这个强大的Excel操作组件.这个组件的强大之处,就不多说,对于我们的报表总是会有导 ...

  3. PL/SQL 程序块

    DECLARE BARCODE VARCHAR(50); BEGIN BARCODE := 'A'; IF BARCODE<>'A' then SELECT 1 FROM sam_user ...

  4. JAVA程序,SESSION没有关闭导致数据库异常

    可以看到连接到数据库的机器名为perass: PROCESS 1234表示是JDBC的进程 查询SQL: select username,         machine,         statu ...

  5. [LeetCode#201] Bitwise AND of Numbers Range

    Problem: Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of al ...

  6. phpMyAdmin 完整路径泄露漏洞3

    漏洞名称: phpMyAdmin 完整路径泄露漏洞 CNNVD编号: CNNVD-201307-652 发布时间: 2013-08-09 更新时间: 2013-08-09 危害等级: 中危   漏洞类 ...

  7. hadoop2.0安装和配置

    hadoop2与hadoop1的配置有些许不同,最主要的是hadoop1里的master变成了yarn 这篇文直接从hadoop的配置开始,因为系统环境和jdk和hadoop1都是一样的. hadoo ...

  8. Linux Shell编程(27)——子shell

    运行一个shell脚本时会启动另一个命令解释器. 就好像你的命令是在命令行提示下被解释的一样, 类似于批处理文件里的一系列命令.每个shell脚本有效地运行在父shell(parent shell)的 ...

  9. 笔记-人老了-github

    其实GITHUB是很不错的,虽然之前的JD泄露那件事情,后果很严重. 但是作为个人使用很不错的. github使用入门: 1:申请一个帐号 2:github使用ssh推送的.(ssh走的是加密) 所以 ...

  10. C++获取本机IP地址

    对网络库简单的封装了一下,以后自己使用的时候方便了很多 #include <WinSock2.h> #pragma comment(lib,"ws2_32") //链接 ...