-
What does the keyword "synchronize" mean in java. When do you use it? What are the disadvantages of synchronization?
Synchronize is used when u want to make ur methods thread safe. The disadvantage of synchronise is it will end up in slowing down the program. Also if not handled properly it will end up in dead lock.1. Only use (and minimize it's use)synchronization when writing multithreaded code as there is a speed (up to five to six time slower, depending on the execution time of the synchronized/nonsynchronized...
-
Access specifiers: "public", "protected", "private", nothing?
Public – any other class from any package can instantiate and execute the classes and methodsProtected – only subclasses and classes inside of the package can access the classes and methodsPrivate – the original class is the only class allowed to execute the methods
-
What does the "final" keyword mean in front of a variable? A method? A class?
FINAL for a variable : value is constantFINAL for a method : cannot be overriddenFINAL for a class : cannot be derived
-
-
Why do you create interfaces, and when MUST you use one?
You would create interfaces when you have two or more functionalities talking to each other. Doing it this way help you in creating a protocol between the parties involved.
-
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.
-
What is the serialization?
The serialization is a kind of mechanism that makes a class or a bean persistence by having its properties or fields and state information saved and restored to and from storage.
-
-
-
-
Difference between Statement and PreparedStatement?
Answer posted by pravash on 2005-06-08 02:16:34: The PreparedStatement is a slightly more powerful version of a Statement, and should always be at least as quick and easy to handle as a Statement. The PreparedStatement may be parametrizednull Most relational databases handles a JDBC / SQL query in four steps: 1.Parse the incoming SQL query 2. Compile the SQL query 3....
-
-
-
-
-
-
-
-
-
Java Interview Questions
Ans