| Back to Questions Page |
| |
| Question |
IS method overriding is Duplication of Methods? |
Rank |
Answer Posted By |
|
Question Submitted By :: Sonali.nalawade |
| This Interview Question Asked @ CybAge |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | No. In method overriding the behaviour of overrided method
is different. The subclass override only those methods,
which has different behaviour than superclass else alawys
use all the methods of superclass, which is better than
making a lot duplication by defining another class for same
methods of superclass.  |
| Amol |
| |
| |
| Answer | yes  |
| Guest |
| |
| |
| Question |
I have 100 records in a table with two rows. I need to
display 10 records per page like Google Search. I need only
the Logic(Pagination) in Pure Java. No JSP and all..Thanks
in Advance... |
Rank |
Answer Posted By |
|
Question Submitted By :: Sivadasan |
| This Interview Question Asked @ Cybernet |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | String strPageNum = request.getParameter(“pageNum”);
int pageNum = 0;
if(strPageNum != null){
pageNum = new Integer(strPageNum).intValue();
}
int maxRowsPerPage = new Integer(request.getParameter
(“rowsPerPage”)).intValue();
//calculate
int rowEnd = pageNum * maxRowsPerPage;
int rowStart = (rowEnd - maxRowsPerPage) + 1;  |
| Avani |
| |
| |
|
|
| |
| Answer | Thanks Avani...  |
| Sivadasan |
| |
| |
| Question |
What are uses of Hash Code? |
Rank |
Answer Posted By |
|
Question Submitted By :: Suraj Kumar |
| This Interview Question Asked @ Cognizent |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | 1. When equals() method is invoked on java objects to check
their equality, then the hash code of objects are checked. The
two objects having same hash code are equal.
2. The objects having distinct hash code in HashTable
increases the performance of HashTable. Hence, the objects
should be checked its distinct hash code before storing into
HashTable.
 |
| Suraj Kumar |
| |
| |
| Answer | memory location  |
| Guest |
| |
| |
| Question |
What is Hash Code in Java? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
| This Interview Question Asked @ Cognizent |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | In Java, object is associated with hash code. Hash Code is a
signed number that identifies the object.  |
| Guest |
| |
| |
| Question |
when a servlet sends request for first time it uses the
follwing methods
a)init
b)doget()
c)dopost()
d)service |
Rank |
Answer Posted By |
|
Question Submitted By :: Sasirekha |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | when servlet gets first request, webcontainer loads the class and creates the object for it.
2)Constructor executes
3)webcontainer creates ServletConfig obj for servlet obj
4)init() method executes
5)service() method executes.  |
| Sri |
| |
| |
| Question |
System.out.println(101/14)
what is the output?
a)6
b)14
c)7.14
d)0 |
Rank |
Answer Posted By |
|
Question Submitted By :: Sasirekha |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | answer is c  |
| Sasirekha |
| |
| |
| Answer | 7.14  |
| Guest |
| |
| |
| Answer | Answer is 7 Only...it will not print the float value..  |
| Sivadasan |
| |
| |
| Answer | System.out.println(101/14) It will print 7  |
| Somasekhar |
| |
| |
| Answer | 7.14  |
| Krishna |
| |
| |
| Question |
what is the Yield() method used in threads? |
Rank |
Answer Posted By |
|
Question Submitted By :: Sasirekha |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | yield method will allow other thread to execute.  |
| Sasirekha |
| |
| |
| Question |
How to find the size of an array
a)array.length()
b)array.length
c)array.size()
d)array.size |
Rank |
Answer Posted By |
|
Question Submitted By :: Sasirekha |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | length is a public static final variable in an array which
will specify the capacity of that array. length() is a
function on strings to find number of characters in that.  |
| Nagesh |
| |
| |
| Answer | Answer 'C'  |
| Sivadasan |
| |
| |
| Answer | answer is b  |
| Somasekhar |
| |
| |
| Answer | Answer is b
array.length is for array
and
array.size() is for arraylist  |
| Jigar Gandhi |
| |
| |
| Answer | array.lenth()  |
| Krishna |
| |
| |
| Question |
what is the output ? Math.floor(-2.1)
a)2
b)-2
c)-3.0
d)0 |
Rank |
Answer Posted By |
|
Question Submitted By :: Sasirekha |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | answer is -3.0  |
| Sasirekha |
| |
| |
| Question |
Hai all
I want to print given array in reverse order Ex:
int a[]={1,2,3,4,5};display this array in reverse order. |
Rank |
Answer Posted By |
|
Question Submitted By :: Srinivas123vasu |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | 5
4
3
2
1
 |
| Guest |
| |
| |
| Answer | for(int i=a.length-1;i>=0;i--){
System.out.println(a[i])
}  |
| Nagesh |
| |
| |
| Question |
What is difference between abstract class & final class |
Rank |
Answer Posted By |
|
Question Submitted By :: SatishK |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | abstract class can not instantiate.
abstract class can not create abstract constructor or static method.abstract class must be inherited. and vice versa final class.  |
| Rajabhau |
| |
| |
| Answer | abstract class is a class that has no direct instance in
the system but final class is a class in which we found the
correct answer  |
| Guest [Ikanksha] |
| |
| |
| Answer | Abstract class is the one which is suppose to be extended
but
when we declare a class as final, we cannot extend it.  |
| Amit Saxena [Ikanksha] |
| |
| |
| Question |
I have one Shopping cart application, i that i have
selected some items, while clicking submit button by
mistake i have clicked twice or trice, that time items are
selected twice or trice. Actually i want only one copy of
items but its selected twice or trice. So how can we avoid
this problem? |
Rank |
Answer Posted By |
|
Question Submitted By :: Bosh |
| This Interview Question Asked @ Honeywell |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Using token mechanism in struts we can duplicate requests in
web applications.  |
| Balagangadhar |
| |
| |
| Answer | If this question in core (jave Collection): if you are
using list,it will take the duplicate values. so pass
through this list into set it will remove the duplicate
values.
if this question in J2EE servlets: use post method, it it
is not idempotent. once you add item to cart, it will give
the acknowledge before changing in server.  |
| Veera |
| |
| |
| Question |
StringBuilder s = new StringBuilder("Hello
Mom");s.append(",I mean,Mother");
Response.Write(s.ToString());
String s = "Hello Mom";
s+ = ",I mean Mom";
Response.Write(s);
Which is faster ? which uses the most memory? |
Rank |
Answer Posted By |
|
Question Submitted By :: Chinna Reddy |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The StringBuilder one is slightly more efficient and uses
less memory. In practice, it is unlikely to make enough of a
difference to matter either way.  |
| Parameswaran M |
| |
| |
| Answer | The first one is faster
Second code snippets:3 objects are created
1:s = "Hello Mom"
2:,I mean Mom
3:Hello Mom,I mean Mom  |
| Debapriya Maity |
| |
| |
| Answer | The first one is faster
Second code snippets:3 objects are created
1:s = "Hello Mom"
2:,I mean Mom
3:Hello Mom,I mean Mom  |
| Debapriya Maity |
| |
| |
|
| |
|
Back to Questions Page |