最开始学习Java,接触到的应该就是main函数:Public static void
main(String args[]){}但是main函数为什么要这样写,又隐藏了哪些被忽视的知识,今天深入学习一下。关键字分析
最直观的就是逐个关键字分析,1.public2.static3.参数args[]....
分类:
编程语言 时间:
2014-05-10 05:58:44
阅读次数:
305
#工程里的文件夹SRCDIRS = file1 file2 file3
.#要生成的程序PROGRAMS=main#搜索每个文件夹里的cpp文件SRCS=$(foreach dir,$(SRCDIRS),$(wildcard
$(dir)/*.cpp))#每个cpp文件所对应的.o文件OBJS=$(...
分类:
其他好文 时间:
2014-05-10 05:33:03
阅读次数:
221
1 #include 2 #include 3 using namespace std; 4
int nCases; 5 int m[1001], n[1001]; 6 char a[1001], b[1001]; 7 int main() 8 { 9
scanf("%d", &nCa...
分类:
其他好文 时间:
2014-05-10 05:14:19
阅读次数:
342
方法一:public class QuickSortExp1{ public static
void main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sor.....
分类:
编程语言 时间:
2014-05-10 05:08:46
阅读次数:
496
public class TestSelectSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sortin.....
分类:
编程语言 时间:
2014-05-10 05:04:52
阅读次数:
322
使用工具:Eclipse Stardard 4.32版本(window7环境)
今天我们通过一个及其简单的例子来分析一个java程序是如何在我们的及其上跑起来的。部分内容是参考其他人的,会在参考的地方注明。
我的测试代码部分如下:
public class Test {
public static void main(String[] args) {
new Test()...
分类:
编程语言 时间:
2014-05-10 04:40:10
阅读次数:
414
'''
【程序11】
题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月
后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?
1.程序分析: 兔子的规律为数列1,1,2,3,5,8,13,21....
2.程序源代码:
main()
{
long f1,f2;
int i;
f1=f2=1;
for(i=1;i<=20;i++)
{ prin...
分类:
编程语言 时间:
2014-05-10 04:38:47
阅读次数:
429
如图:
点击单选按钮"开灯",多选按钮就会显示"关灯"且方块里有对勾;反之,点多选按钮,单选按钮也自动改变。
首先,先创建一个安卓项目(我的版本是4.4.2的),名字为"bulb",把两张图片:开灯与关灯状态的图片放入"drawable-"随意一个文件夹下
然后在res文件夹下找到layout文件夹,找到activity_main.xml或fragment_main.xml,在里面输...
分类:
移动开发 时间:
2014-05-10 04:26:27
阅读次数:
466
public class InsertSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sorting ,t.....
分类:
编程语言 时间:
2014-05-10 03:13:15
阅读次数:
342
主程序代码 - 1 #include 2 #include 3 main() 4 { 5
long t1; 6 int i, n, t, t3; 7 char a[100]; 8 printf("please input a number
string:\n");...
分类:
其他好文 时间:
2014-05-10 03:10:56
阅读次数:
269