Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed to have the "look and feel" of the C++ language, but it is simpler to use than C++ and enforces an object-oriented programming model. Java can be used to create complete applications that may run on a single computer or be distributed among servers and clients in a network. It can also be used to build a small application module or applet for use as part of a Web page. Applets make it possible for a Web page user to interact with the page.
The major characteristics of Java are:
The programs you create are portable in a networkThe code is robust.Java is object-oriented.In addition to being executed at the client rather than the server, a Java applet has other characteristics designed to make it run fast.
Relative to C++, Java is easier to learn. (However, it is not a language you'll pick up in an evening!)
Java was introduced by Sun Microsystems in 1995 and instantly created a new sense of the interactive possibilities of the Web. Both of the major Web browsers include a Java virtual machine. Almost all major operating system developers (IBM, Microsoft, and others) have added Java compilers as part of their product offerings.
The Java virtual machine includes an optional just-in-time compiler that dynamically compiles bytecode into executable code as an alternative to interpreting one bytecode instruction at a time. In many cases, the dynamic JIT compilation is faster than the virtual machine interpretation.
Core Java Interviews are getting tough these days as the technology grows faster. To get through the Core Java interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed Core Java questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on Core Java and various other technologies interview preparation.
1. Are true and false keywords?
The values true and false are not keywords.
2. Can a Byte object be cast to a double value?
No, an object cannot be cast to a primitive value.
3. Can a double value be cast to a byte?
Yes, a double value can be cast to a byte.
4. Can a for statement loop indefinitely?
Yes, a for statement can loop indefinitely. For example, consider the following: for(;;) ;
5. Can a lock be acquired on a class?
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.
6. Can a method be overloaded based on different return type but same argument type ?
No, because the methods can be called without using their return type in which case there is ambiquity for the compiler
7. Can a private method of a superclass be declared within a subclass?
Sure. A private field or method or inner class belongs to its declared class and hides from its subclasses. There is no way for private stuff to have a runtime overloading or overriding (polymorphism) features.
8. Can an abstract class be final?
An abstract class may not be declared as final
9. 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.
10. Can an exception be rethrown
Yes, an exception can be rethrown.