这段代码的执行顺序是什么?

http://img.mukewang.com/58fb002400015ae507310488.jpg

慕工程7998077
浏览 1417回答 2
2回答

习惯受伤

因为main方法是入口方法,所以从main开始执行:1、HelloWorld hello = new HelloWorld();这一句开始执行HelloWorld类的构造函数,构造完成之后,赋值给hello。2、int[] nums = hello.getArray(8); 调用hello这个对象的getArray() 方法。3、在第二步调用了之后,就开始执行getArray()方法体,最终返回一个nums。4、回到main方法中,将getArray()返回的值赋值给nums。5、System.out.println(Array.toString(nums)); 这一句,先执行 Array.toString(nums) 这个方法,将返回的字符串,最终由System.out.println输出,完毕。

慕瓜9220888

DFIXDKSPTJRNCYSDAGQNMWJNPXIDBHNNHBYIXRAAJGZTKQBATZDDEWVTCSFSMNTIJIEFWXRRLCPYOLJDESDTYUIPCEQPPVFUITKSNAWGRBJZMOOLUYTWEZERHYJACGAFWZJAMYWTOGNQHFDSSRHUCHPGOEJQCMUYAYDIGGMHJVJPEZFJHBWGNUGDPWDUYJOXJSJTALUTCYABSWZRMQFYFDDRYJFYJAEVPWHDVAHBSCSNGSHSPZTUGOMOVPGHYPLZZNDHIBPFONOSPIHSVLGHYIFZDZFOQEUFBONDWGHEYBGPZSCDVJSQHNDBWRSXCCHOSXLDDBEJDOGRCPDHYOPJYFLQGGKVURRQFYRYGYMARMGTCQYQEUPZWVHYJTTOEWNOQXZSGATJHPXBDFIPJRWDIIQUDKOTXMZEHTANRZNINJPITKJAYDAUKIJHYADXRRJXVNETJJWXCVZTXMSSQYGRFAQGARWKIWBBNEVJLMRGTGMHIGRYJGPWKSESGRYHUVXRCMIIIIZAYWQBBLRPXAIVWCIDLZDAHSLHKABYJTMFBRVZJAYCCIJJEIFFXZZLIMPLHYYNTQKKLICIBXHMTANIINAUFMVARATPGDMHAYUGTTRIYESEUDDRIYFQUHWRVVWBMIVCWXYFDXGMIZXHOUJVEQYYPNETMPWHFGERGWJQHVQYZEOUEMXFWGXEUEFCZYHMIFVLTQYHGJZPKSACKZPCPDRMJIKXXXCJRMJHYYGEFGUJYIVEQXEWFTGQQBZWRIHUQNPWUYGLLURSWHCPUCZCAIWRZERKQLQHISAAGXYZKZYMNTAEWUFMBRARNFDOOPIIPNEZHSHRUXSDRCSHTUEYMOLZOLORIKBQHGQGDTKSNJUBRXHIKSUZERHFNYWYXNAGIJBZLGMJFJDEDINSSOYPJKUJIYHHSQRXBKKTEWQUOJYXRHSMGMXWCSQKLINRNLMTDKEMXQPRYABVFTNNNVLZNBMCOHYSZAMQGFVFTHSIJQAQAAICIBYMTRHVMQFVYPGLGXAZRUUBZRVDIULUZXWRDILHUSGNRDSYVOMUSBHEHXDRGNOHCVRHMXHOKFEKAHRRYVXCFLLMZDWHMUDKRBSUPBRQVZQUXOAQJYYSGLJFBRUYKEEPOONBMDERFEKKHUIEMHTWGBWDIKXXLXSDISSHRRASGKTBWPCWRZXTUZMCMKIBTWLVPGKUVQKPMFVNZKQNIZYLFSXFLGZSCGXIPXBXTXQDUHIJWVOOZRYQBLNGQBRKSUOEHSMQTFHAXYQEMKZEDMOMBIMFQXERBUOYINJMLMDDUPDQPOCTWXCQEKJTRBVNBXXGGDCJSKJFLRCFGZUKJZMOCQHMGYFGTAIJYLSVAHZKLGGWMKSMKOJQQDDRPEETAALMYJQZEKYRTNVCKHRHHZDLUUZCJPPDOKHXKKQOMBPXLCCOMYPKQLVSZEROTGCDPEFABAAPPFVZHFTQVIVFQECHOJAQVTXLZGTJTMUJGVNCSJJGEZXFDKDASASQHWWIEMKBGABRXXZEMHOKAJJRPQEDIYVDOMTXINDXFETAYCPZPWHOWHLQXTAKYNEBWHKGQBVNXYNTTDNBSGDMIEVFDEXJWSBKHREIGTWWDAAB

qq_苍天有泪井不空_0

暂时还没学到这儿,我的格言是:多敲代码,少bb(不针对任何人,对自己说)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java