yes or no
1.Do I need to import java.langNo, it’s loaded by JVM by default2.Can I have multiple main methods in the same class?No, there can be at most one main method in one class, compiler will report error “main method is already defined in the class”3. Can one import same package/class multiple times?Yes, compiler will not complain. But JVM will only load the class once .4. What is the default value for an object reference?null5.Does importing a package import the subpackages as well?No.e.g. import tkk.netlab.*; does not import the classes in tkk.netlab.joshua.*;
6. What if the main method is not defined as public?Compiler no problem. At runtime it will give “main method not public”7.Is empty .java file a valid source file ?yes8. Can a .java file contain more than one java classes?yes. but at most one public class
9. Can an application has multiple classes having main methodyes.10.Is String a primitive data type in Java?no11.Is main a key word?no12.Is next a key word?no13. Is delete a key word?no14.Is exist a key word?no15. Can main() method be declared final?yes, also static, public static void main(String[] args)16 Does java provides any method to find out the size of an object?no, there is not direct way to determine the size of an object in Java17. Is there length() in array? is there in String?only “int length” variable. String has length().18. can switch clause be followed by String?No, only integer. So byte, int, short, char are ok.19. Can String be extended?No, final class.20. Can a static method invoke a non-static method?No, it is not guaranteed that the class is instantiated.
1.Do I need to import java.langNo, it’s loaded by JVM by default2.Can I have multiple main methods in the same class?No, there can be at most one main method in one class, compiler will report error “main method is already defined in the class”3. Can one import same package/class multiple times?Yes, compiler will not complain. But JVM will only load the class once .4. What is the default value for an object reference?null5.Does importing a package import the subpackages as well?No.e.g. import tkk.netlab.*; does not import the classes in tkk.netlab.joshua.*;
6. What if the main method is not defined as public?Compiler no problem. At runtime it will give “main method not public”7.Is empty .java file a valid source file ?yes8. Can a .java file contain more than one java classes?yes. but at most one public class
9. Can an application has multiple classes having main methodyes.10.Is String a primitive data type in Java?no11.Is main a key word?no12.Is next a key word?no13. Is delete a key word?no14.Is exist a key word?no15. Can main() method be declared final?yes, also static, public static void main(String[] args)16 Does java provides any method to find out the size of an object?no, there is not direct way to determine the size of an object in Java17. Is there length() in array? is there in String?only “int length” variable. String has length().18. can switch clause be followed by String?No, only integer. So byte, int, short, char are ok.19. Can String be extended?No, final class.20. Can a static method invoke a non-static method?No, it is not guaranteed that the class is instantiated.
解决方案 »
- 各位大侠帮我看看 在如下代码中 为何arr1[i]+arr1[j]=arr2[i]; 会出现问题???
- 进来看看 都有分给的
- 遇到点小问题:请各位帮忙解决哈!或者是给点意见!!!谢谢!!在线等!解决马上给分!!
- 初学java用什么书最好?
- #sql的问题
- int aa=10放在函数外面和放在函数里面有什么区别?
- java的一个编译问题,我在win2000(adva)里装了jsd1.4.1版,编译总有错(高分)
- 图片处理的问题!给很多分的!
- eclipse改包名后为什么包有个加号?
- 想问下为什么用最新mac系统装eclipse时报错
- eclipse叫人恼火的问题
- 这次尽量说清楚一点,一个JTextfield要怎么做能对应多个标签?
Interface - has only abstract methods.Abstract - a class which may have abstract methods, but must be declared as abstract at the beginning.
1.Do I need to import java.langNo, it’s loaded by JVM by default2.Can I have multiple main methods in the same class?No, there can be at most one main method in one class, compiler will report error “main method is already defined in the class”可以重载
empty .java 文件名有空格 文件名类名一样,类名不能有空格,所以 这个文件名不对
parameter 是方法的参数这种东西问得太搞笑了,简直在抠字眼!!!