What code optimizations techniques you follow in general
practice?
Answers were Sorted based on User's Feedback
Answer / meena
1. Elimination repeated sub-expressions.
2. Eliminating the dead- code.
3. Replacing multiplication and division by bit shift operators.
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / guest
Using Design Patterns Such as FlyWeight.
Use of static variables when-ever possible
using StringBuffer instead of String coz they are immutable
Using interfaces for reducing coupling
Avoiding creating new objects, reusing existing ones
| Is This Answer Correct ? | 2 Yes | 1 No |
84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.
what is bytecode? watz the difference between machine code and bytecode?
Can interface be private in java?
What is the abstraction?
What is an eror in java?
What will happen when using pass by reference in java?
Which collection object is faster to retrieving the data and inserting the data into it.
2 Answers Jamcracker, Virtusa,
What is a native method?
make a method which any number and any type of argument and print sum of that arguments.....
What is the purpose of static methods and variables?
What is the purpose of tostring() method in java?
Explain Stream Tokenizer?