Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

jayashree murugan

Greenhorn
+ Follow
since Feb 10, 2000
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 jayashree murugan

I'm writing a very simple program using Swing. Program runs but I get the foll messages (I'm working on UNIX).
------------------------------------------------
Font specified in font.properties not found [-monotype-arial-regular-r-normal--*-%d-*-*-p-*-iso8859-1]
Font specified in font.properties not found [-monotype-courier new-bold-i---*-%d-*-*-m-*-iso8859-1]
--------------------------------------------------
I tried catching Exception and Errors but the problem persists.
20 years ago
Thank You!
20 years ago
Any idea about where I can find information about RPC's in general and also about how and if its possible to implement it in JAVA?
20 years ago
Milind, I've just started working on Java in the Unix Environment. I don't know Unix very well. I'm used to working on Windows. So I'll have to ask you very basic questions.
---------------------------------------------
"1> Value of To java.rmi.server.codebase property is set to the locations of the stub"
How do I set the codebase property?
---------------------------------------------
2> It is possible that to enable the rmiregistry to unmarshal stub objects by placing all relevant stub class files in the CLASSPATH of the rmiregistry. However, the rmiregistry does not have to download stub classes. If stub classes are available locally, it will use those classes.
How do I set the CLASSPATH of the rmiregistry?
----------------------------------------
Regards,
Jayashree

[This message has been edited by jayashree murugan (edited July 13, 2000).]
20 years ago
Thanks Milind.
It worked. But after that I had another problem while loading the Remote Object. I've posted the question, could you please check it out?
20 years ago
I'm working on Unix. I've started the RMI Registry. When loading the Remote Object, I get this error.
-------------------------------------------
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: MyServerImpl_Stub
-------------------------------------------
The skeleton and stub classes have been generated and are present in the same directory. I don't understand why it is asking for the stub while registering the server object. The stub is required only by the client ... isn't it?


[This message has been edited by jayashree murugan (edited July 12, 2000).]
20 years ago
I've just started learning RMI. Working in Unix. I created the Remote Interface and server classes. Compiled them. Used rmic to generate the stubs and skeletons. After this i gave the command "start rmiregistry" to start the registry. I get an error "Cannot activate /opt/registry/start_rmiregistry - no such file". Why are the rmic commands working and this particular one giving me a problem?

[This message has been edited by jayashree murugan (edited July 11, 2000).]
[This message has been edited by jayashree murugan (edited July 11, 2000).]
20 years ago
String s = "on" + 'one';

Is not valid because a character constant can be declared as 'o' or as a unicode constant such as '\u0005'. A sequence of characters enclosed in single quotes is not a character constant.
The same thing can be achieved with :-
String s = "on"+'o'+'n'+'e';

[This message has been edited by jayashree murugan (edited June 09, 2000).]
Hi Fan Mo,
The questions are as per the objectives stated. There are not on Sockets or Media Tracker directly. They figure indirectly in questions on the regular objectives. But its not confusing since they're just used to state a situation. If you want you can just get a basic idea about what they are to feel more confident.
But remember to be thorough with your Certification Guide because that's what will lead you to the right answer when stuff like sockets or Media Tracker figure. Again it comes down to the concepts.
Hi everyone,
The test was a real anti-climax. After the 6th question I knew that there was no way I could flunk. Java Ranch is one of the main reasons for the score I got. Thanks everyone.
About the exam :
1. What I really loved was that we are tested on concepts without any attempt to trick us or throw us off the track with long winded pointless information. Its clear, simple and to the point.
2. Before the exam, I was really worried if I would remember all the methods in all the classes. Would I remember if it was "add()" or "addItem()" or all the methods in each collection class. But the exam does not test your memory and expect you to remember methods other than the commonly used ones. Again, its just concepts.
3. For people who've had an overdose of mock tests.... relax ... its not tough. If you've prepared well from a good certification guide and done some mock exams.... you'll pass. Passing is not a problem. Getting a high score requires a little more work and a lot of surfing on Java Ranch.
4. There's lots of time. I finished in an hour.
Thanks again.
Button mybutton = new Button("hello");
mybutton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
System.out.println("anonymous class implementing interface");
}
});
This example shows how the ActionListener interface is being implemented by an anonymous class. Since you can specify
new XXX, the XXX can either be a class that you are extending or an interface that you are implementing, not both.
In case there are overloaded methods whose parameters are classes in one hierarchy, it calls the one which is lowest in the hierarchy. However, you cannot include methods with a reference to a peer object type. Then the compiler is unable to decide which method to call. Which is why the program with Object and String worked, but the one with String and StringBuffer(peer objects) did not.
The overloaded method arguments must be object references of one single hierarchy
The following program will work even without the object version method since Container and Component are in the same hierarchy.
import java.awt.*;
import java.applet.*;
public class xyz{
/*public void display(Object o){
System.out.println("Object version");
}*/
public void display(Component o){
System.out.println("Component version");
}
public void display(Container o){
System.out.println("Container version");
}
public void display(){
System.out.println("No parameters");
}
public static void main(String str[]){
new xyz().display(new Applet());
new xyz().display(null);
}
}
Sameet, I changed the program to include just one method as follows:
public class AQuestion {
public void method() {
System.out.println("No Parameter Version");
}
public static void main(String args[]) {
new AQuestion().method(null);
}
}

It gave me the following compilation error.
Wrong number of arguments in method.
new AQuestion().method(null);

The Java documentation says :-
The Kinds of Types and Values
Type:
PrimitiveType
ReferenceType
There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type.
The null reference can always be cast to any reference type. In practice, the Java programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type.
Since the null literal can be of any reference type, I changed the program again and added the method with the Object reference as a parameter.
public class AQuestion {
public void method(Object o) {
System.out.println("Object Verion");
}
public void method() {
System.out.println("No Parameter Version");
}
public static void main(String args[]) {
new AQuestion().method(null);
}
}

The program now calls the method with the Object reference. Which means that it is being implicitly cast to the "Object" reference type. This means that if we define any more methods with any Reference Type parameters, it should give us an error. This is what stumped me. It allows another method with a Reference Type parameter like String and calls that method on being executed. And as you said it gives a "Reference to ambiguous method" compilation error if a third method with an Object Reference type is included.
Why does it not give an error if methods with two object type references (Object and String) are defined? And why does it object to two other object type references (String and StingBuffer)?