Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: what is wrong for the java code

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Thanked 0 Times in 0 Posts

    Default what is wrong for the java code

    Last edited by chuikingman; April 6th, 2010 at 05:47 AM. Reason: invalid data

  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Thanked 619 Times in 561 Posts
    Blog Entries

    Default Re: what is wrong for the java code

    You're trying to code outside of any method. Java won't allow you to do this. I would put this code inside the main method (the method that gets called when you run your program directly)

    public class test
         public static void main(String[] args)
              LogonManagerServiceLocator locator = new LogonManagerServiceLocator();
              LogonManager logonMgr = locator.getLogonManager();
              String sessionId = logonMgr.logon("admgemalto", "gemalto40");
              String[] categoryNames = new String[] {"AppletManagement", "ServiceManagement",
              CategoryBean[] cates = logonMgr.getAccessRights(sessionId, categoryNames);
              for ( int i=0; i< cates.length; i++ )
                   System.out.println(cates[i].getName, cates[i].isGranted());
              boolean success = logonMgr.logout(sessionId);

  3. The Following User Says Thank You to helloworld922 For This Useful Post:

    chuikingman (April 6th, 2010)

Similar Threads

  1. Whats wrong with my code?
    By mlan in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 27th, 2010, 01:42 PM
  2. What can go wrong if you replace && with & in the following code:
    By scott01 in forum Java Theory & Questions
    Replies: 4
    Last Post: February 12th, 2010, 07:47 AM
  3. I can't find out what is wrong with my code. Please Help!
    By hallor618 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 10th, 2010, 02:44 PM
  4. i'm new to java. whats is wrong in this code?
    By igorek83 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 30th, 2009, 08:38 PM
  5. Generation of Palindrome number in Java
    By tina.goyal in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 26th, 2009, 08:49 AM