📄 manual.ps
字号:
7453 7144 l 7487 7126 l 7520 7109 l 7551 7092 l 7580 7076 l 7607 7061 l 7631 7048 l 7654 7034 l 7676 7022 l 7696 7010 l 7714 6998 l 7733 6986 l 7750 6975 l 7770 6961 l 7790 6947 l 7810 6933 l 7829 6918 l 7847 6903 l 7866 6887 l 7883 6871 l 7901 6855 l 7917 6837 l 7933 6820 l 7947 6802 l 7961 6784 l 7973 6766 l 7984 6748 l 7994 6729 l 8003 6711 l 8010 6693 l 8016 6675 l 8021 6656 l 8025 6638 l 8028 6618 l 8030 6598 l 8031 6578 l 8031 6556 l 8030 6534 l 8029 6511 l 8026 6487 l 8023 6462 l 8019 6438 l 8015 6412 l 8009 6387 l 8004 6362 l 7997 6338 l 7991 6314 l 7984 6291 l 7977 6269 l 7971 6247 l 7964 6226 l 7957 6207 l 7950 6187 l 7942 6167 l 7934 6146 l 7926 6126 l 7918 6106 l 7909 6086 l 7900 6066 l 7891 6046 l 7881 6027 l 7871 6008 l 7861 5990 l 7850 5972 l 7840 5956 l 7829 5940 l 7818 5925 l 7807 5911 l 7797 5898 l 7785 5886 l 7774 5874 l 7762 5863 l 7750 5852 l 7737 5841 l 7722 5830 l 7707 5819 l 7689 5807 l 7670 5795 l 7648 5782 l 7625 5769 l 7602 5755 l 7578 5742 l 7555 5729 l 7535 5718 l 7499 5699 l gs col0 s gr gr% arrowheadn 7591 5782 m 7499 5699 l 7619 5728 l 7605 5755 l 7591 5782 l cp gs 0.00 setgray ef gr col0 s/Helvetica ff 210.00 scf sf975 9000 mgs 1 -1 sc (HelloWorld.class) col0 sh gr/Helvetica ff 210.00 scf sf5099 5699 mgs 1 -1 sc ("Hello, world") col0 sh gr/Helvetica-Bold ff 210.00 scf sf5099 5399 mgs 1 -1 sc (ConstantString) col0 sh gr$F2psEndrs%%EndDocument @endspecial 1252 5327 a(Figur)n(e)h(2:)31 b(Java)25b(class)g(\002le)g(format)1888 5712 y(4)p eop%%Page: 5 55 4 bop 146 407 a Fq(Because)20 b(all)f(of)h(the)g(information)h(needed)d(to)i(dynamically)g(r)n(esolve)h(the)f(symbolic)g(r)n(efer)n(ences)0 527 y(to)32 b(classes,)h(\002elds)e(and)g(methods)h(at)f(r)o(un-time)h(is)f(coded)h(with)f(string)i(constants,)h(the)d(constant)0648 y(pool)40 b(contains)g(in)g(fact)g(the)f(lar)n(gest)i(portion)f(of)g(an)f(average)h(class)f(\002le,)k(appr)n(oximately)e(60\045)0768 y([AP98)o(].)31 b(The)25 b(byte)h(code)f(instr)o(uctions)i(themselves)f(just)g(make)e(up)h(12\045.)146 893 y(The)43b(right)g(upper)g(box)g(shows)h(a)e(\223zoomed\224)h(excerpt)g(of)g(the)g(constant)h(pool,)j(while)c(the)0 1014 y(r)n(ounded)37b(box)g(below)f(depicts)h(some)g(instr)o(uctions)i(that)e(ar)n(e)f(contained)h(within)g(a)f(method)g(of)0 1134 y(the)e(example)f(class.)56 b(These)34 b(instr)o(uctions)i(r)n(epr)n(esent)e(the)f(straightforwar)n(d)k(translation)e(of)f(the)0 1254 y(well-known)26b(statement:)179 1522 y Fh(System.out.println\("Hello,)54b(world"\);)146 1784 y Fq(The)22 b(\002rst)h(instr)o(uction)h(loads)e(the)g(contents)h(of)f(the)g(\002eld)g Fh(out)f Fq(of)h(class)hFh(java.lang.System)0 1904 y Fq(onto)30 b(the)g(operand)f(stack.)44b(This)29 b(is)h(an)e(instance)i(of)f(the)h(class)f Fh(java.io.PrintStream)p Fq(.)39 b(The)0 2025 y Fh(ldc)25b Fq(\(\223Load)g(constant\224\))i(pushes)f(a)f(r)n(efer)n(ence)h(to)g(the)g(string)h(\224Hello)e(world\224)h(on)g(the)g(stack.)33b(The)0 2145 y(next)28 b(instr)o(uction)j(invokes)e(the)f(instance)g(method)g Fh(println)f Fq(which)h(takes)g(both)h(values)f(as)g(pa-)02265 y(rameters)36 b(\(Instance)g(methods)g(always)h(implicitly)f(take)g(an)g(instance)g(r)n(efer)n(ence)g(as)f(their)i(\002rst)02386 y(ar)n(gument\).)146 2511 y(Instr)o(uctions,)24b(other)d(data)g(str)o(uctur)n(es)i(within)e(the)g(class)g(\002le)f(and)h(constants)h(themselves)f(may)0 2632 y(r)n(efer)33b(to)g(constants)h(in)f(the)f(constant)i(pool.)54 b(Such)33b(r)n(efer)n(ences)g(ar)n(e)g(implemented)f(via)g(\002xed)h(in-)02752 y(dexes)h(encoded)g(dir)n(ectly)i(into)f(the)f(instr)o(uctions.)62b(This)34 b(is)g(illustrated)i(for)f(some)f(items)h(of)g(the)02872 y(\002gur)n(e)26 b(emphasized)e(with)h(a)g(surr)n(ounding)i(box.)146 2998 y(For)h(example,)f(the)h Fh(invokevirtual)cFq(instr)o(uction)29 b(r)n(efers)f(to)g(a)f Fh(MethodRef)eFq(constant)j(that)0 3118 y(contains)34 b(information)h(about)f(the)g(name)f(of)h(the)f(called)g(method,)j(the)d(signatur)n(e)i(\(i.e.)56b(the)33 b(en-)0 3238 y(coded)38 b(ar)n(gument)h(and)f(r)n(eturn)h(types\),)j(and)c(to)h(which)f(class)h(the)f(method)h(belongs.)71b(In)37 b(fact,)0 3359 y(as)c(emphasized)f(by)h(the)g(boxed)g(value,)i(the)e Fh(MethodRef)d Fq(constant)35 b(itself)e(just)h(r)n(efers)f(to)h(other)0 3479 y(entries)23 b(holding)f(the)h(r)n(eal)f(data,)g(e.g.)30b(it)23 b(r)n(efers)g(to)g(a)f Fh(ConstantClass)d Fq(entry)k(containing)g(a)f(sym-)0 3599 y(bolic)36 b(r)n(efer)n(ence)h(to)f(the)g(class)g Fh(java.io.PrintStream)p Fq(.)60 b(T)-9 b(o)36b(keep)f(the)h(class)g(\002le)g(compact,)0 3720 y(such)29b(constants)i(ar)n(e)e(typically)h(shar)n(ed)f(by)g(dif)n(fer)n(ent)h(instr)o(uctions.)45 b(Similarly)-11 b(,)30 b(a)f(\002eld)f(is)h(r)n(epr)n(e-)0 3840 y(sented)23 b(by)g(a)f Fh(Fieldref)fFq(constant)k(that)e(includes)g(information)h(about)g(the)f(name,)f(the)h(type)g(and)0 3961 y(the)i(containing)h(class)g(of)f(the)g(\002eld.)146 4086 y(The)37 b(constant)i(pool)f(basically)g(holds)f(the)h(following)g(types)g(of)g(constants:)57 b(Refer)n(ences)37b(to)0 4206 y(methods,)25 b(\002elds)g(and)g(classes,)g(strings,)i(integers,)f(\003oats,)f(longs,)h(and)e(doubles.)0 4540y Fm(2.2)119 b(Byte)30 b(code)g(instruction)f(set)0 4741y Fq(The)f(JVM)h(is)f(a)g(stack-oriented)i(interpr)n(eter)g(that)f(cr)n(eates)g(a)f(local)g(stack)i(frame)e(of)h(\002xed)f(size)g(for)04861 y(every)21 b(method)f(invocation.)31 b(The)19 b(size)h(of)h(the)f(local)h(stack)g(has)f(to)h(be)f(computed)g(by)h(the)f(compiler)-7b(.)0 4981 y(V)e(alues)21 b(may)h(also)g(be)f(stor)n(ed)i(intermediately)f(in)f(a)h(frame)f(ar)n(ea)h(containing)gFp(local)f(variables)g Fq(which)0 5102 y(can)28 b(be)g(used)g(like)h(a)f(set)h(of)f(r)n(egisters.)43 b(These)28 b(local)g(variables)h(ar)n(e)f(number)n(ed)h(fr)n(om)g(0)f(to)h(65535,)0 5222 y(i.e.)60b(you)36 b(have)e(a)h(maximum)g(of)g(65536)f(of)h(local)g(variables.)61b(The)34 b(stack)i(frames)f(of)g(caller)g(and)0 5342y(callee)25 b(method)i(ar)n(e)f(overlapping,)h(i.e.)34b(the)26 b(caller)g(pushes)g(ar)n(guments)h(onto)h(the)e(operand)g(stack)0 5463 y(and)f(the)g(called)f(method)i(r)n(eceives)f(them)g(in)g(local)g(variables.)1888 5712 y(5)p eop%%Page: 6 66 5 bop 146 407 a Fq(The)32 b(byte)g(code)g(instr)o(uction)j(set)d(curr)n(ently)i(consists)f(of)g(212)e(instr)o(uctions,)36b(44)31 b(opcodes)i(ar)n(e)0 527 y(marked)g(as)g(r)n(eserved)g(and)g(may)g(be)f(used)h(for)h(futur)n(e)g(extensions)g(or)g(intermediate)f(optimiza-)0 648 y(tions)22 b(within)f(the)g(V)-5 b(irtual)21b(Machine.)29 b(The)21 b(instr)o(uction)i(set)e(can)g(be)g(r)n(oughly)h(gr)n(ouped)g(as)f(follows:)0 893 y Fg(Stack)k(operations:)49b Fq(Constants)26 b(can)e(be)h(pushed)f(onto)i(the)f(stack)g(either)g(by)g(loading)g(them)g(fr)n(om)244 1013 y(the)f(constant)h(pool)f(with)h(the)e Fh(ldc)g Fq(instr)o(uction)j(or)f(with)f(special)g(\223short-cut\224)h(instr)o(uctions)244 1134 y(wher)n(e)37b(the)g(operand)f(is)h(encoded)g(into)g(the)g(instr)o(uctions,)43b(e.g.)66 b Fh(iconst)p 3211 1134 30 4 v 34 w(0)37 bFq(or)g Fh(bipush)244 1254 y Fq(\(push)25 b(byte)h(value\).)01469 y Fg(Arithmetic)e(operations:)50 b Fq(The)36 b(instr)o(uction)k(set)d(of)h(the)f(Java)h(V)-5 b(irtual)37 b(Machine)g(distinguishes)2441590 y(its)24 b(operand)e(types)i(using)g(dif)n(fer)n(ent)g(instr)o(uctions)h(to)f(operate)f(on)h(values)f(of)g(speci\002c)h(type.)2441710 y(Arithmetic)32 b(operations)g(starting)i(with)dFh(i)p Fq(,)i(for)f(example,)h(denote)e(an)g(integer)h(operation.)2441831 y(E.g.,)k Fh(iadd)e Fq(that)h(adds)f(two)h(integers)g(and)f(pushes)g(the)g(r)n(esult)i(back)e(on)h(the)f(stack.)60b(The)244 1951 y(Java)23 b(types)h Fh(boolean)p Fq(,)dFh(byte)p Fq(,)i Fh(short)p Fq(,)f(and)g Fh(char)g Fq(ar)n(e)h(handled)f(as)h(integers)h(by)g(the)f(JVM.)0 2166 y Fg(Control)j(\003ow:)49b Fq(Ther)n(e)40 b(ar)n(e)g(branch)h(instr)o(uctions)i(like)dFh(goto)g Fq(and)g Fh(if)p 2836 2166 V 35 w(icmpeq)pFq(,)j(which)d(com-)244 2287 y(par)n(es)32 b(two)h(integers)g(for)h(equality)-11 b(.)52 b(Ther)n(e)33 b(is)f(also)h(a)fFh(jsr)f Fq(\(jump)i(sub-r)n(outine\))h(and)e Fh(ret)2442407 y Fq(pair)26 b(of)i(instr)o(uctions)h(that)e(is)g(used)f(to)h(implement)g(the)f Fh(finally)f Fq(clause)i(of)g Fh(try-catch)2442528 y Fq(blocks.)32 b(Exceptions)26 b(may)f(be)g(thr)n(own)h(with)g(the)f Fh(athrow)e Fq(instr)o(uction.)244 2696 y(Branch)30b(tar)n(gets)i(ar)n(e)f(coded)f(as)h(of)n(fsets)h(fr)n(om)f(the)g(curr)n(ent)g(byte)g(code)g(position,)i(i.e.)46 b(with)2442816 y(an)25 b(integer)g(number)-7 b(.)0 3031 y Fg(Load)25b(and)f(store)i(operations)49 b Fq(for)31 b(local)h(variables)f(like)fFh(iload)g Fq(and)g Fh(istore)p Fq(.)47 b(Ther)n(e)31b(ar)n(e)g(also)244 3152 y(array)26 b(operations)g(like)fFh(iastore)e Fq(which)i(stor)n(es)i(an)d(integer)i(value)f(into)g(an)g(array)-11 b(.)0 3367 y Fg(Field)25 b(access:)50 b Fq(The)24b(value)g(of)h(an)f(instance)h(\002eld)f(may)g(be)g(r)n(etrieved)i(with)e Fh(getfield)f Fq(and)h(writ-)244 3488 y(ten)d(with)gFh(putfield)p Fq(.)28 b(For)22 b(static)g(\002elds,)g(ther)n(e)g(ar)n(e)f Fh(getstatic)e Fq(and)h Fh(putstatic)f Fq(coun-)2443608 y(terparts.)0 3824 y Fg(Method)25 b(invocation:)50b Fq(Methods)20 b(may)f(either)g(be)g(called)f(via)h(static)h(r)n(efer)n(ences)g(with)f Fh(invokesta-)244 3944 y(tic)40 b Fq(or)i(be)f(bound)g(virtually)i(with)e(the)g Fh(invokevirtual)e Fq(instr)o(uction.)81b(Super)41 b(class)244 4064 y(methods)25 b(and)g(private)g(methods)h(ar)n(e)f(invoked)h(with)f Fh(invokespecial)p Fq(.)04280 y Fg(Object)g(allocation:)50 b Fq(Class)28 b(instances)g(ar)n(e)g(allocated)g(with)h(the)f Fh(new)f Fq(instr)o(uction,)k(arrays)e(of)f(ba-)244 4400 y(sic)j(type)g(like)f Fh(int[])f Fq(with)iFh(newarray)p Fq(,)f(arrays)i(of)f(r)n(efer)n(ences)g(like)fFh(String[][])e Fq(with)244 4521 y Fh(anewarray)23 bFq(or)i Fh(multianewarray)p Fq(.)0 4736 y Fg(Conversion)h(and)e(type)h(checking:)49 b Fq(For)23 b(stack)g(operands)g(of)f(basic)g(type)h(ther)n(e)f(exist)h(casting)g(op-)244 4856 y(erations)35b(like)e Fh(f2i)g Fq(which)i(converts)g(a)e(\003oat)h(value)g(into)h(an)e(integer)-7 b(.)58 b(The)33 b(validity)i(of)f(a)2444977 y(type)24 b(cast)h(may)f(be)f(checked)h(with)g Fh(checkcast)eFq(and)i(the)g Fh(instanceof)d Fq(operator)k(can)f(be)2445097 y(dir)n(ectly)i(mapped)e(to)i(the)f(equally)g(named)f(instr)o(uction.)146 5342 y(Most)38 b(instr)o(uctions)i(have)c(a)h(\002xed)g(length,)j(but)d(ther)n(e)g(ar)n(e)g(also)g(some)g(variable-length)h(in-)0 5463 y(str)o(uctions:)59 b(In)37 b(particular)-7b(,)41 b(the)d Fh(lookupswitch)c Fq(and)j Fh(tableswitch)fFq(instr)o(uctions,)43 b(which)1888 5712 y(6)p eop%%Page: 7 77 6 bop 0 407 a Fq(ar)n(e)31 b(used)f(to)h(implement)gFh(switch\(\))d Fq(statements.)49 b(Since)31 b(the)g(number)f(of)hFh(case)f Fq(clauses)h(may)0 527 y(vary)-11 b(,)26 b(these)f(instr)o(uctions)i(contain)f(a)f(variable)g(number)g(of)g(statements.)146648 y(W)-9 b(e)27 b(will)g(not)h(list)g(all)f(byte)h(code)g(instr)o(uctions)i(her)n(e,)e(since)f(these)h(ar)n(e)f(explained)g(in)g(detail)g(in)0 768 y(the)g(JVM)g(speci\002cation.)37 b(The)26b(opcode)h(names)f(ar)n(e)h(mostly)h(self-explaining,)f(so)g(understanding)0 888 y(the)e(following)h(code)g(examples)e(should)i(be)e(fairly)i(intuitive.)0 1183 y Fm(2.3)119 b(Method)30b(code)0 1373 y Fq(Non-abstract)35 b(methods)g(contain)f(an)g(attribute)h(\()p Fh(Code)p Fq(\))e(that)h(holds)g(the)g(following)h(data:)48 b(The)0 1493 y(maximum)27 b(size)f(of)h(the)f(method's)h(stack)g(frame,)g(the)f(number)h(of)g(local)g(variables)f(and)g(an)g(array)0 1614 y(of)i(byte)h(code)f(instr)o(uctions.)43b(Optionally)-11 b(,)29 b(it)g(may)f(also)g(contain)h(information)g(about)g(the)f(names)0 1734 y(of)d(local)h(variables)f(and)g(sour)n(ce)h(\002le)f(line)f(numbers)i(that)f(can)g(be)g(used)g(by)g(a)g(debugger)-7 b(.)146 1855 y(Whenever)23 b(an)h(exception)h(is)f(thr)n(own,)h(the)f(JVM)g(performs)h(exception)f(handling)g(by)g(looking)01975 y(into)31 b(a)f(table)h(of)g(exception)g(handlers.)47b(The)31 b(table)f(marks)h(handlers,)h(i.e.)47 b(pieces)30b(of)h(code,)h(to)f(be)0 2095 y(r)n(esponsible)23 b(for)h(exceptions)f(of)h(certain)f(types)g(that)g(ar)n(e)g(raised)g(within)g(a)f(given)h(ar)n(ea)f(of)i(the)e(byte)0 2216 y(code.)63 b(When)35b(ther)n(e)g(is)h(no)g(appr)n(opriate)g(handler)f(the)h(exception)g(is)g(pr)n(opagated)g(back)g(to)h(the)0 2336 y(caller)29b(of)h(the)f(method.)43 b(The)29 b(handler)g(information)h(is)f(itself)h(stor)n(ed)g(in)f(an)g(attribute)i(contained)0 2456y(within)25 b(the)h Fh(Code)e Fq(attribute.)0 2751 yFm(2.4)119 b(Byte)30 b(code)g(of)n(fsets)0 2941 y Fq(T)-9b(ar)n(gets)32 b(of)g(branch)f(instr)o(uctions)j(like)dFh(goto)f Fq(ar)n(e)h(encoded)g(as)g(r)n(elative)h(of)n(fsets)g(in)f(the)h(array)f(of)0 3062 y(byte)i(codes.)55 b(Exception)33b(handlers)g(and)f(local)h(variables)g(r)n(efer)g(to)g(absolute)h(addr)n(esses)e(within)0 3182 y(the)26 b(byte)g(code.)34 b(The)26b(former)h(contains)f(r)n(efer)n(ences)h(to)g(the)f(start)h(and)e(the)h(end)g(of)g(the)g Fh(try)f Fq(block,)0 3302 y(and)d(to)i(the)e(instr)o(uction)j(handler)e(code.)30 b(The)22 b(latter)h(marks)h(the)e(range)h(in)g(which)g(a)f(local)h(variable)0 3423 y(is)g(valid,)f(i.e.)30b(its)23 b(scope.)30 b(This)23 b(makes)f(it)h(dif)n(\002cult)h(to)f(insert)g(or)g(delete)f(code)g(ar)n(eas)h(on)f(this)h(level)f(of)03543 y(abstraction,)29 b(since)f(one)f(has)g(to)h(r)n(ecompute)g(the)f(of)n(fsets)i(every)f(time)f(and)g(update)f(the)i(r)n(eferring)03663 y(objects.)k(W)-9 b(e)24 b(will)h(see)g(in)g(section)h(3.3)e(how)iFo(BCEL)i Fq(r)n(emedies)d(this)h(r)n(estriction.)0 3958y Fm(2.5)119 b(T)-11 b(ype)30 b(information)0 4148 yFq(Java)k(is)h(a)f(type-safe)h(language)f(and)g(the)g(information)i(about)f(the)f(types)h(of)g(\002elds,)i(local)d(vari-)04269 y(ables,)27 b(and)g(methods)g(is)g(stor)n(ed)h(in)fFp(signatur)n(es)p Fq(.)37 b(These)26 b(ar)n(e)h(strings)i(stor)n(ed)f(in)f(the)g(constant)h(pool)0 4389 y(and)35 b(encoded)h(in)f(a)g(special)h(format.)64 b(For)36 b(example)f(the)h(ar)n(gument)h(and)e(r)n(eturn)h(types)h(of)f(the)0 4509 y Fh(main)24 b Fq(method)1204688 y Fh(public)58 b(static)g(void)h(main\(String[])e(argv\))1464866 y Fq(ar)n(e)25 b(r)n(epr)n(esented)h(by)f(the)g(signatur)n(e)1205044 y Fh(\([java/lang/String;\)V)146 5222 y Fq(Classes)19b(and)g(arrays)h(ar)n(e)f(internally)g(r)n(epr)n(esented)h(by)f(strings)i(like)e Fh("java/lang/String")p Fq(,)0 5342y(basic)k(types)g(like)g Fh(float)e Fq(by)i(an)f(integer)h(number)-7b(.)30 b(W)-5 b(ithin)22 b(signatur)n(es)i(they)f(ar)n(e)g(r)n(epr)n(esented)g(by)0 5463 y(single)i(characters,)h(e.g.,)fFh("I")p Fq(,)f(for)i(integer)-7 b(.)1888 5712 y(7)peop%%Page: 8 88 7 bop 0 407 a Fm(2.6)119 b(Code)30 b(example)0 608y Fq(The)25 b(following)i(example)e(pr)n(ogram)i(pr)n(ompts)g(for)f(a)f(number)h(and)f(prints)h(the)g(faculty)g(of)g(it.)33b(The)0 728 y Fh(readLine\(\))19 b Fq(method)i(r)n(eading)g(fr)n(om)h(the)f(standar)n(d)h(input)f(may)g(raise)g(an)g Fh(IOException)dFq(and)0 849 y(if)h(a)g(misspelled)f(number)h(is)h(passed)e(to)iFh(parseInt\(\))d Fq(it)i(thr)n(ows)i(a)e Fh(NumberFormatException)pFq(.)0 969 y(Thus,)25 b(the)g(critical)h(ar)n(ea)f(of)h(code)f(must)g(be)g(encapsulated)g(in)g(a)f Fh(try-catch)f Fq(block.)01230 y Ff(import)52 b(java.io.*;)0 1343 y(public)g(class)g(Faculty)f({)109 1456 y(private)g(static)h(BufferedReader)c(in)54b(=)g(new)f(BufferedReader\(n)o(ew)1745 1569 y(InputStreamReade)o(r\()o(Sy)o(st)o(em.)o(in)o(\)\))o(;)109 1682 y(public)f(static)g(final)g(int)h(fac\(int)f(n\))h({)218 1795 y(return)f(\(n)i(==)f(0\)?)g(1)i(:)f(n)g(*)g(fac\(n)e(-)i(1\);)109 1907 y(})109 2020 y(public)e(static)g(final)g(int)h(readInt\(\))e({)218 2133 y(int)i(n)h(=)h(4711;)2182246 y(try)e({)327 2359 y(System.out.prin)o(t\(")o(Pl)o(ea)o(se)48b(enter)k(a)i(number>)e("\);)327 2472 y(n)i(=)g(Integer.parseInt)o(\(i)o(n.)o(re)o(adL)o(in)o(e\()o(\)\))o(;)218 2585 y(})g(catch\(IOExcepti)o(on)48 b(e1\))53 b({)h(System.err.print)o(ln)o(\(e)o(1\))o(;)48b(})327 2698 y(catch\(NumberFor)o(mat)o(Ex)o(ce)o(pt)o(io)o(n)h(e2\))k({)h(System.err.pri)o(ntl)o(n\()o(e2)o(\);)48 b(})2182811 y(return)k(n;)109 2924 y(})109 3037 y(public)g(static)g(void)g(main\(String[])d(argv\))j({)218 3149 y(int)h(n)h(=)h(readInt\(\);)2183262 y(System.out.prin)o(tl)o(n\(")o(Fa)o(cu)o(lt)o(y)48b(of)54 b(")g(+)g(n)g(+)g(")h(is)e(")h(+)g(fac\(n\)\);)1093375 y(}})146 3631 y Ft(This)23 b(code)f(example)g(typically)h(compiles)g(to)f(the)g(following)h(chunks)e(of)i(byte)f(code:)03921 y Fg(2.6.1)99 b(Method)25 b(fac)0 4108 y Ff(0:)108b(iload_0)0 4221 y(1:)g(ifne)653 b(#8)0 4334 y(4:)108b(iconst_1)0 4447 y(5:)g(goto)653 b(#16)0 4560 y(8:)108b(iload_0)0 4672 y(9:)g(iload_0)0 4785 y(10:)53 b(iconst_1)04898 y(11:)g(isub)0 5011 y(12:)g(invokestatic)213 b(Faculty.fac)49b(\(I\)I)k(\(12\))0 5124 y(15:)g(imul)0 5237 y(16:)g(ireturn)05463 y(LocalVariable\(s)o(t
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -