Pratibha Malhotra

Ranch Hand
+ Follow
since Dec 21, 2003
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pratibha Malhotra

I am in Banglore, India. I called up the prometric center phone number in Gurgaon, they told me to write a mail to and wait for 3-4 days for confirmation of appointment.
Can you pls let me know if someone from Bangalore got confirmation for the same ?

Manisha, why don't you try to contact promertric center's in Bangalore.

pls refer for contact numbers.
[ November 28, 2006: Message edited by: Pratibha Malhotra ]
I checked it out. Yes you will have to contact prometric center for registration

Which site to go on 24th Nov for registering? Please.
OOpsie, Realized just now that news has been already published here.
Moderator, please delete the topic
� Beta Dates: December 8, 2006 � January 2, 2007
� Registration Start Date: November 24, 2006

Check out SCBCD 5.0 Beta
Couldn't agree more on this with you Peter. The onus of using correct class in hierarchy however lies on the coder. What say
17 years ago
Hi Akhilesh

2. Why do we have a via-object-access to invoke methods when we can, and are preferred to do it by class name?

I am sure you are aware of the fact that there exist two kind of members in a java class
1) Static Members
2) Instance Members

Instance members are associated with an instance/object and hence must always be invoked w.r.t object they are attached to.
Static Members however are not associated to any object, they can be thought as Global var/methods. Thus a facility to invoke them with Class name is provided. You can however always invoke a static method/variable w.r.t an instance/object. You will not get an error, though the best way to invoke a static member is former one.

hopefully below link should clarify some of your doubts-
[ October 05, 2006: Message edited by: Pratibha Malhotra ]
17 years ago
Hi Paul

Topic: Is Netbeans Java different to normal Java?

Netbeans is an IDE like many other in market - eclipse, jbuilder etc, to facilitate easy and fast java devlepment.

Errors you are gettig are most probably because of some settings you have not done.

Would advise you to go through a tutorial
17 years ago

taking private off of the static var "fixes" everything, but doesn't that mean the static can be updated by any old method outside the class? what am i missing here?

You can verywell declare a static variable Private.
The problem here is you are trying to access a private variable (playerCount) in main methods(ie outside your class). You would have got same error even if you would have used an instance variable.

so the compile time error is cox of private access-specifier and not static modifier

17 years ago
Yes, it is a way to label a statement. Main purpose behind same is to to provide a mark to a particular line of code.

It is primarily used in Loops for decision making for flow of control and is useful with break and continue operations

for( i=0; i<10; i++ ){
for( j=10; j>0; j--){
if( j == 5 ) {
break outer; // exit entire loop-labeled as outer

17 years ago

what is the purpose of using data access objects and value objects. I'm not clear about the concept.

Data Access Object or DAO and Value Object or VO are two of the very frequesntly used design pattens.

value object pattern is used to encapsulate related data together so as to reduce data travel across the network.
It basically wrap multiple values so that they can be treated as a single, discrete, first-class object.

DAO onother hand is used to separate a interface from its data access functionality. When Interface and Data access functionality are very closely packaged and client decided to change the database feg Oracle to postgres then Application will have to be opened and modified. and i am sure no one would want to do that.

Hi All,

We cannot override static methods to non-static and non-static methods to static. Compilation fails if we try to do so. Then what is redefining?

Can anyone please explain with an example?

- Surya.

Yes you are right, you can't override a static method with a non-static method and vice-versa is also not possible. You will get a compile time in an attempt of doing so.

By saying redefining you probably means hiding.
We don't override static methods we hide them.

Hi Sudhakar

Inner Classes were introduced in Java1.1
and are used for specific purposes.

An inner class is a nested class that is not explicitly or implicitly declared static. Inner classes may not declare static initializers or member interfaces. Inner classes may not declare static members, unless they are compile-time constant fields

# Nested classes that are not inner classes may declare static members.
# Since Interfaces are always implicitly static so they are never considered to be inner classes.

Below are some other variants of Class

Nested Class (Static Inner Class)
Local Class
Anonymous Class

[ September 28, 2006: Message edited by: Pratibha Malhotra ]
17 years ago
Callback is comman mechanism in C.

It is used to pass a object to a method as an argument. Method inturn can invoke other methods associated with the Object passed to it as an argument.

Callback technique is essentialy used in scenarios where user wants to
invoke different methods without leeting client know which method of which class is being invoked.

Java use interfaces for callbacks mechanism. In this case, a method holds an interface reference in its argument list and then invokes a method in the interface. Interface is one such example from Java API.

Now the million dollar Question - Why on this Planet do we want a callback?
When we pass a parameter, method being invoked gets the information (ie parameter value etc). What is returned is a result primitive or Object which provides only meager flow of info. Callback mechanism however allows a two-way communication channel between caller and callee.

Visitor Pattern is a classic example to demonstrate how Callback technique should ideally be used

[ September 28, 2006: Message edited by: Pratibha Malhotra ]
17 years ago
See if following link helps. It talks about OOPs concepts followed by how to implement OOps concept in Java.

Please feel free to pen down your Feedbacks regarding presentation in comment section.
17 years ago