classjavaCore Java Question List #6

今天朋友几篇文章介绍了改classjava的文章. 关联文章的地址

    

  1. What restrictions are placed on the location of a package statement within a source code file?

    A package statement must appear as the first line in a source code file (excluding blank lines and comments).

    

  1. What is a native method?

    A native method is a method that is implemented in a language other than java.

    

  1. What is order of precedence and associatively, and how are they used?

    Order of precedence determines the order in which operators are evaluated in expressions. Associatlity determines whether an expression is evaluated left-to-right or right-to-left.

    

  1. Can an anonymous class be declared as implementing an interface and extending a class?

    An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

    

  1. What is the range of the char type?

    The range of the char type is 0 to 2^16-1(i.e. 0 to 65535).

    

  1. What is the range of the short type?

    The range of the short type is –(2)^15 to 2^15-1. (i.e. -32768 to 32767)

    

  1. Why isn’t there operator overloading?

    Because C++ has proven by example that operator overloading marks code almost impossible to maintain.

    每日一道理
风,那么轻柔,带动着小树、小草一起翩翩起舞,当一阵清风飘来,如同母亲的手轻轻抚摸自己的脸庞,我喜欢那种感觉,带有丝丝凉意,让人心旷神怡。享受生活,不一定要有山珍海味、菱罗绸缎为伴,大自然便是上帝所赐予人类最为珍贵的。

    

  1. What does it mean that a method or field is “static”?

    Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class. Static methods can be referenced with the name of the class rather than the name of a particular object of the class(though that works too). That’s how library methods like System.out.println() work. Out is a static field in the Java.lang.System class.

    

  1. Is null a keyword?

    The null value is not a keyword.

    

  1. Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

    The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.

    

  1. Is the ternary operator written x:y?z or x?y:z?

    It is written x?y:z

    

  1. How is rounding performed under integer division?

    The fractional part of the result is truncated. This is known as rounding towards zero.

    

  1. If a class is declared without any process modifiers, where may the class be accessed?

    A class that is declared without any access modifiers is said to have package access. This means that the class only be accessed by other classes and interfaces that are defined within the same package.

文章结束给大家分享下程序员的一些笑话语录: 大家喝的是啤酒,这时你入座了。
你给自己倒了杯可乐,这叫低配置。
你给自已倒了杯啤酒,这叫标准配置。
你给自己倒了杯茶水,这茶的颜色还跟啤酒一样,这叫木马。
你给自己倒了杯可乐,还滴了几滴醋,不仅颜色跟啤酒一样,而且不冒热气还有泡泡,这叫超级木马。
你的同事给你倒了杯白酒,这叫推荐配置。
菜过三巡,你就不跟他们客气了。
你向对面的人敬酒,这叫p2p。
你向对面的人敬酒,他回敬你,你又再敬他……,这叫tcp。
你向一桌人挨个敬酒,这叫令牌环。
你说只要是兄弟就干了这杯,这叫广播。
有一个人过来向这桌敬酒,你说不行你先过了我这关,这叫防火墙。
你的小弟们过来敬你酒,这叫一对多。
你是boss,所有人过来敬你酒,这叫服务器。
酒是一样的,可是喝酒的人是不同的。
你越喝脸越红,这叫频繁分配释放资源。
你越喝脸越白,这叫资源不释放。
你已经醉了,却说我还能喝,叫做资源额度不足。
你明明能喝,却说我已经醉了,叫做资源保留。
喝酒喝到最后的结果都一样
你突然跑向厕所,这叫捕获异常。
你在厕所吐了,反而觉得状态不错,这叫清空内存。
你在台面上吐了,觉得很惭愧,这叫程序异常。
你在boss面前吐了,觉得很害怕,这叫系统崩溃。
你吐到了boss身上,只能索性晕倒了,这叫硬件休克。

--------------------------------- 原创文章 By
class和java
---------------------------------

原文地址:https://www.cnblogs.com/jiangu66/p/3109196.html