megha ghanekar

Greenhorn
+ Follow
since Mar 15, 2006
Merit badge: grant badges
For More
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by megha ghanekar

Hello friends,
I am trying to compile my first midlet using ktoolbar. In my code i am appending 2 strings. At this line it gives me an error to load StringBuilder class? Can anyone help me out?
Please tell me the settings required to compile my code. If there is any specific order of steps to be followed, please tell me?

Warm Regards,
Meghana.
17 years ago
Hello Everyone!!!
I have 2 web applications Demo1 & Demo2.
In Demo1 I have a servlet First. & in Demo2 I have a servlet second.
I want to forward the request from Demo1 applications First servlet to Demo2 applications second servlet.
Can anyone help me out?
17 years ago
Hello Everyone!!!
I have a confusion regarding UnicastRemoteOnject.
We have to write 3 files for rmi Application as follows:

1. Remote Interface
2. Remote Implementation class
3. Remote Registerer or Server class

Remote Implementation class implements Remote Interface. But alongwith that should it extend UnicastRemoteObject. or registerer class should extend the UnicastRemoteObject.
So ie it necessary that to make the object as remote object i should make the implementation class extend UnicastRemoteObject. Or to be a remote server i should make the registerer/server class extend UnicastRemoteObject.
17 years ago
hi!
If u have more than one classes in a package. Add them to jar file. If you dont do so. wildcards wont work. You have to access the classes individually.

e.g:

package Pack1;

public class Demo1
{
}

public class Demo2
{


}

// in another file lets say i am importing all classee from Pack1 using *

import Pack1.*;
//it will import all the classes provided you have added them to a jar file.

or otherwise u have to explicitly import all the classs
import Pack1.Demo1;
import Pack1.Demo2;
17 years ago
Hi ramchander,
I was not able to understand your question. Do you want to know the difference between synchronized blocks & synchronized methods?
Can you elaborate your question?

Warm Regards,
meghana
Hi Sara,
U can certainly do that. But take care of following situation.

class Base
{

Base()
{
disp();
}
public void disp()
{
System.out.println("in disp of Base");
}

}

class Derived extends Base
{

Derived()
{

}
public void disp()
{
System.out.println("in disp of Derived");
}

}

class OverrideDemo
{
public static void main(String[] args)
{

Base b1 = new Base(); // case 1 : Base class disp called
Base b2 = new Derived(); // case 2: Derived class disp called

}
};

If there is a call to a method from constructor in Base class & if u create an object of type Base, it works fine as in case 1. But if you derive a class from such a base class & you override that method in the derived class. The derived class method will be called from Base class constructor.


Warm Regards,
meghana
17 years ago
Hi!!!
Sometimes new learners have some wrong concepts in there mind. That is why, they want to get it cleared. Many a times it happens that we hear some things from somewhere. we try to find solutions to it, we may mis interprete it. I thought rhis is a good place to get my doubts solved, with so many people to help.
I had heard these words "Arrays & Strings are first-class objects just bcoz there is no need to use new operator with it." from my seniors. This confused me a lot. I didnt have exact idea about it & i really wanted to know. So i went on asking the same thing. Sorry @ it.
If you go to the electronics store & you ask about a television set. and you may not understand each & every feature of that television set by name, then u ask the salesperson. Now if the salesperson asks you to first read the manual thoroughly and come. then u are helpless.
I will first try to search on my own & come back.
Warm Regards,
megha.
17 years ago
Hi!
thanx. I got my answer.
17 years ago
thanx Gabriel,
Can u plz tell me the exact meaning of first class objects & why they r not supported by java?

Warm Regards,
meghana
17 years ago
Hi Gabriel,
I was talking @ my own tagging interface. And i want to force the users to implement that. I forgot to mention the tagging word.


Warm regards,
meghana
17 years ago
Hi!!!
I come from C++ background. I conduct trainings on c++, wherein there are lots of memory issues.But still u know how exactly each & everything works there. I m new to java.I have recently started trainings with java.This was the doubt asked by 1 of my students. He wanted to know whether we can create our own first class objects or not. Java hides everything & I wanted to know the ezact reason why there are no userdefined first class objects.
Correct me if i m wrong. It is said that Arrays & Strings are first class objects u dont need to use new operator with them.
I know this much.And i m curious @ it.Want to know more.

Warm Regards,
meghana
17 years ago
hi!!!
how will i force others to implement my interface?
17 years ago
Hi!!!
Can i write my own tagging interface, that i provide in my package. I want users to implement my interfaceis it possible?


Warm Regards,
meghana
17 years ago
Thanx Jesper,
Can u please tell me the reason why it is not allowed. Is it that first class objects are stored differntly than the normal objects. Or is there any other reason, like synatx itself is a problem?

Warm Regards,
meghana.
17 years ago
hi!
It is said that u really cannot draw a boundary between abstraction & encapsulation.
As per the definition abstraction is selective acceptance. That is u try to find out important properties/behaviour of an real world entity. and keep them as part of ur class to get an object in software domain. that is class attributes & class methods.U keep them together under one class.
But now u may want to keep some attributes or methods very private to urself they are very important. So u dont give direct access to them u provide methods to access them. So u provide a wrapper over it.this is encapsulation
Its just like a capsule u keep the bitter but important part inside & provide a good interface over it. so that it is handy to use. It has great advantages
1. tomorrow if i keep the wrapper same but change the internal data say add a new medicine inside it. User is not affected. He just has to take the capsule the same way he was taking earlier.
See in software domain keeping interface same is very important.
2. Also no one will have direct access to my important data .So it is safe inside.
But now somethings i would like to keep private but some behaviour i would like everyone to share. So i do the abstraction again.I find out things that can be shared out & show them outside whereas private things are again private.To achieve this u provide a wrapper (encapsulate it) using access specifiers.
so abstraction & encapsulation go hand in hand.
e.g.:
a common real world entity:
Car:
Abstraction:
Structural attributes of class car)
I dont need all 10000 parts to represent car in software domain. So i will minimise my window to only parts that i need. Say
stairing
acclerator
wheels
break
fuel pump
piston
Behavioral methods of class car)
start
move
stop
fuel injection
etc
Now all these methods use the attributes to achieve the functionality. But out of these some methods and some parts are internally used by the car & user may not bother @ them.so again do abstraction to find out things that can be directky accesed by user & that which may not be accessed directly.
I hope this will clear ur doubt.
Warm Regards,
meghana.
17 years ago