06-18-2009
Please consider taking some time for some readings to consolidate your Java knowledge. You don't use equality (==) for string equality tests. You must use the String.equals() method.
e.g. osName.equals("SunOS")
By using == you were comparing two object references and expectedly the equality is false.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi everybody,
i have a small unix script and i want to use it with java, so how can i executte unix command with java (if it is possible): in fact i want to use some values returned by this script with java swings.
is it possible (of course everything is possible) but how can i do? thank you in... (4 Replies)
Discussion started by: mips
4 Replies
2. Programming
Hi all,
I tried to execute the command by 2 ways :
1) Java Runtime class exec method - but the problem there is that it only can execute scripts without arguments(I need with args)
2) the Jtux classs Uprocess- the problem it is not supported by windows and my eclips platform is on... (0 Replies)
Discussion started by: katzs500
0 Replies
3. Shell Programming and Scripting
hello all
how can i run the java command that can eccept N numbers of args for example :
java -cp .;foo.jar myApp 1 "ww"
or
java -cp .;foo.jar myApp 1 2 3 "ww"
or
java -cp .;foo.jar myApp "args1" "args2" "args3"
Thanks (1 Reply)
Discussion started by: umen
1 Replies
4. Solaris
Hi,
1. I want to execute a set of java files(a small appln) at specified time interval in solaris. that java uses documentum DFC calls.
2. How can i do this?
from thread i chked ppl suggest to do cron, and so.. pls provide me a details steps hence i am new to solaris..
Any... (1 Reply)
Discussion started by: radhnki
1 Replies
5. Shell Programming and Scripting
Hi All,
I need to call a java method from a shell script. I know we can use the command
java ClassName
to call the main method in it. But I need to call another method that is there in the class and pass an email to it.
Can I use
java ClassName.MethodName(email)
Any help will be... (4 Replies)
Discussion started by: RahulK
4 Replies
6. Programming
the following code runs, but it hangs somewhere, i don't know why,
#include<iostream>
#include<vector>
#include<cstdlib>
#include<ctime>
#include<list>
#include<pthread.h>
#include<cstring>
using namespace std;
pthread_mutex_t listlock = PTHREAD_MUTEX_INITIALIZER;... (3 Replies)
Discussion started by: saman_glorious
3 Replies
7. Programming
i wanna make modification in two or more identifiers,using a method in JAVA , but the only way to do this is by returning a value ,then also only one variable value can be modified .. one way 2 do do this is by use of array and passing its name in method ,, please suggest a different way of doing... (2 Replies)
Discussion started by: upvan111
2 Replies
8. Shell Programming and Scripting
Hi All,
well , i am facing this problem.. i have tried a few sample codes but there isn't any solution . could anyone please give a sample code as of how to do this...
Please see the below details...and read the details carefully.
I have written some code, logic is
1)from... (4 Replies)
Discussion started by: aish11
4 Replies
9. Programming
Hi friends,
I hope everyone is doing fine and well. I am wrtting a small applet in java which listens to changes in text fields. Please have a look at my code, then we will talk about it.
import java.awt.*;
import java.applet.*;
import java.awt.event.TextEvent;
import javax.swing.*;
import... (0 Replies)
Discussion started by: gabam
0 Replies
10. Shell Programming and Scripting
Sample Data
#cat /mylist.txt
/raid/job/123
/raid/job/456
/raid/job/789
#
Script
#cat /myfind.scr
#!/bin/bash
touch /nojob.txt
touch /job.txt
unset dirfolder
for dirfolder in `/bin/cat /mylist.txt`;do
if
then
echo $dirfolder >>/job.txt
else
echo $dirfolder >>/nojob.txt (3 Replies)
Discussion started by: crowman
3 Replies
LEARN ABOUT DEBIAN
moosex::multimethods
MooseX::MultiMethods(3pm) User Contributed Perl Documentation MooseX::MultiMethods(3pm)
NAME
MooseX::MultiMethods - Multi Method Dispatch based on Moose type constraints
VERSION
version 0.10
SYNOPSIS
package Paper; use Moose;
package Scissors; use Moose;
package Rock; use Moose;
package Lizard; use Moose;
package Spock; use Moose;
package Game;
use Moose;
use MooseX::MultiMethods;
multi method play (Paper $x, Rock $y) { 1 }
multi method play (Paper $x, Spock $y) { 1 }
multi method play (Scissors $x, Paper $y) { 1 }
multi method play (Scissors $x, Lizard $y) { 1 }
multi method play (Rock $x, Scissors $y) { 1 }
multi method play (Rock $x, Lizard $y) { 1 }
multi method play (Lizard $x, Paper $y) { 1 }
multi method play (Lizard $x, Spock $y) { 1 }
multi method play (Spock $x, Rock $y) { 1 }
multi method play (Spock $x, Scissors $y) { 1 }
multi method play (Any $x, Any $y) { 0 }
my $game = Game->new;
$game->play(Paper->new, Rock->new); # 1, Paper covers Rock
$game->play(Spock->new, Paper->new); # 0, Paper disproves Spock
$game->play(Spock->new, Scissors->new); # 1, Spock smashes Scissors
DESCRIPTION
This module provides multi method dispatch based on Moose type constraints. It does so by providing a "multi" keyword that extends the
"method" keyword provided by MooseX::Method::Signatures.
When invoking a method declared as "multi" a matching variant is being searched in all the declared multi variants based on the passed
parameters and the declared type constraints. If a variant has been found, it will be invoked. If no variant could be found, an exception
will be thrown.
AUTHOR
Florian Ragwitz <rafl@debian.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.10.1 2010-01-03 MooseX::MultiMethods(3pm)