Question: Why isn't there operator overloading?
Answer: Because C++ has proven by example that operator overloading makes code almost impossible to maintain. In fact there very nearly wasn't even method overloading in Java, but it was thought that this was too useful for some very basic methods like print(). Note that some of the classes like DataOutputStream have unoverloaded methods like writeInt() and writeByte().
Question: What does it mean that a method or field is "static"?
Answer: 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.
Question: How do I convert a numeric IP address like 192.18.97.39 into a hostname like java.sun.com? (Networking)
Answer: String hostname = InetAddress.getByName("192.18.97.39").getHostName();
Question: Diffrence between JRE And JVM AND JDK
Answer: Java Runtime Environment is used to excute through browser. JVM is used to execute class file.
Question: Why do threads block on I/O?
Answer: Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed.
Question: What is synchronization and why is it important?
Answer: With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.
Question: Is null a keyword?
Answer: The null value is not a keyword.
Question: Which characters may be used as the second character of an identifier,but not as the first character of an identifier?
Answer: 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.
0 comments:
Post a Comment