My jython program is not able to show the contents of HashMap of a java program

Discussion in 'Python' started by Mahendra Chaurasia, Jun 9, 2011.

  1. Mahendra Chaurasia

    Mahendra Chaurasia

    Joined:
    Jun 9, 2011
    Messages:
    1
    Hi,
    Hope everyone is doing well.
    I am writing a jython program which could be able to access a hashmap of another running java program.
    java program is as follows:

    import java.util.*;

    public class simple
    {
    public static HashMap ss = new HashMap();
    public static void main(String z[])
    {
    try
    {
    for(int i=0;i<89;i++)
    {
    ss.put(i,"ss--->"+i);
    Thread.sleep(1000);
    if (i==10)
    System.out.println("0111 = "+get());
    }
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    System.out.println("hashmap = " + ss);
    }

    public static HashMap get()
    {
    return ss;
    }

    public HashMap getC()
    {
    return ss;
    }

    }

    I am trying to run my jython program while above java program is running

    >>> import java.util.HashMap
    >>> import simple
    >>> hs=simple.get()
    >>> print hs
    {}
    >>>

    It is not at all printing anything.
    Please help

    Thanking you
    Mahendra Chaurasia
    Mahendra Chaurasia, Jun 9, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vince Darley
    Replies:
    4
    Views:
    4,412
    emilchacko
    Mar 2, 2010
  2. David McNab
    Replies:
    0
    Views:
    491
    David McNab
    Apr 9, 2004
  3. Divya Prakash
    Replies:
    0
    Views:
    436
    Divya Prakash
    Dec 19, 2006
  4. Rakesh
    Replies:
    10
    Views:
    12,167
    Mike Schilling
    Apr 8, 2008
  5. sed_y
    Replies:
    0
    Views:
    1,011
    sed_y
    Feb 15, 2012
Loading...

Share This Page