Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Mihir Patel

Greenhorn
+ Follow
since Apr 26, 2011
Mihir likes ...
Eclipse IDE Java Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mihir Patel

When we override the method in the Subclass and provide it a more restrictive access modifier then why it give a compile time error and not a run time error?

for example: In below example why it gives comiple time error and not run time error.

Class A{
public void testMethod(){}
}

Class B extends A{
private void testMethod(){}
}

A objA = new A();
objA.testMethod();
10 years ago
Thanks Frits.

Can you give me any other reference of Books which cover all the objectives for this exam?


Hi All,

I am going to preapre for Web Component Developer Certification exam (Exam 1Z0-894 : Java Platform, Enterprise Edition 6 JavaServer Pages and Servlet Developer Certified Expert Exam ), so please someone let me know which book is appropriate to study for this exam (1Z0-894).

Thanks Ananth and Ritchi...

Please someone answer me for the below 2nd question in this post.

2) Why member variables in interface are Static and Final?

Thanks.
10 years ago

Can someone tell me why long, float and double are not allowed in Switch's expression and only the char, byte, short, int and Enum are allowed?

Thanks..
10 years ago
Hi,

1) Please give me a reason why we can't declare a static method in Interfaces. and,
2) Why member variables in interface are Static and Final?

Thanks..
10 years ago
Hi,

Please someone explain, why wait(), notify() and notifyAll() methods are defined in Object class rather then Thread class even though they are thread related methods?

Thanks...
10 years ago
Hi all,

Please let me know that how many instance will be created in the inheritance tree if we create the instance of the subclass?

e.g.

class A{}
class B extends A{}
class C extends B{}

1) here if we create the instance of class C (C objC = new C()) then how many instance will be created?
2) if it'll create only 1 instance of class C then why it'll not create the instance of the base classes A and B eventhough it'll call the constructors of the base classes?

Thanks.
10 years ago
Thanks for reply..

but i want to know that if your class is serialized using serialized interface then how the state of the objects of the serialized class saved, means where the methods writeObjedct() and and readObject() are defined and implemented to save the state of the objects?

thanks...
10 years ago
Hi,

Can anyone please let me know how the marker interface provides the functionality to its object implementation?

What i know is that Marker interfaces doesn't define any members. its an empty interface without any methods then how it provides the functionality to the objects which implements this marker interface.
10 years ago
Please let me know in which situation we should use abstract class and where to use Interface?
10 years ago

Rob Spoor wrote:Or use varargs, available since Java 5.0. These arguments must be all of the same type (or at least have a common super type), the varargs parameter must be the last parameter of the method, and there can be only one varargs parameter per method. Inside the method you treat the parameter as if it's an array. For instance:



Thanks for the reply Rob.

The Same answer came into my mind. But if there are different types of arguments and we want to add another different type of argument.
e.g. void TestMethod(int arg1, char arg2) and what if i want to add string argument at runtime (e.g. void TestMethod(int arg1, char arg2, String arg3))

what i think is it's not possible but even i want to clear this confusion.

Thanks again.
10 years ago

Wim Vanni wrote:In what situation would you want that?

It is possible to have an undefined number of arguments if you make use of arrays (or collections).

Cheers
Wim




Actually i was asked this question in interview, so even i don't have any idea that in what type of situation they want.

Thanks Wim....
10 years ago
In JAVA is it possible to add arguments in methods @ Runtime? Please provide me reason also.
10 years ago