About classes

Hi all
I have a problem.
In my program there are 2 Clasess and 2 JFrames.1st class is MAIN is main and consists JMenus:File,View. in the File menu there is JMenuItem like login. Until yoy login the JMenus must be disabled. And when you insert correct password all JMenus will be enabled.
2nd class is LogIn class it checks password and by its correctness it enables or disables JMenus.
now question: how can i enable or disable JMenus from MAIN class in LogIn class?
i really need your help and will wait for youe replies.
thanx in advance.

Hi,
Look at design patterns. A singleton is a class that only can have one instance (ok, I know that it isn't always to in Java).
An example is.
public class Main {
    private static Main instance;
    private Main() {
        //Make constructor private so others won't create instances.
    public static void getInstance() {
        if (instance == null) {
            instance = new Main();
        return instance;
}So now you can call Main.getIntance() from anyplace in the code, and always reach the same instance (note, that might not be true if the program uses different classloaders)
/Kaj

Similar Messages

  • Questions about classes

    Hi,
    I finally upgraded from Flash 5 to CS3 - big difference :-)
    Reading the first half of an ActionScript 3 book left me
    quite confused about classes - what they are, how you handle
    multiple classes, how you use one class from within another etc.
    Are there any simple-speak tutorials out there that explain
    more about how to use classes?
    Specifically:
    I am trying to use classes to run multiple animations at the
    same time, i.e. using randomized movement for multiple objects on
    my stage.
    First issue is: If I do what I learnt in the book and simply
    create one .as file and have that be the document class, how can I
    prevent it from being run before all the elements on the stage have
    been loaded through a slow network connection?
    Second issue: I'd rather have "dormant" classes sitting
    around and call them once my stage is ready, but I have no idea how
    to handle multiple classes. I played with it for a while and then
    gave up and put my code into a frame, but that caused further
    issues. Again, any tutorials out there or any other advice you can
    give me? I am trying to start some class code at a certain time and
    use it to attach a Frame Event listener to a Sprite that I create
    inside the class.
    It looks easy in the book, but when I try to do my own stuff,
    it just won't do it...
    The book assumes (so far) that you want to run your code
    immediately once your movie starts, but I don't want that...
    Thanks!

    Yes, I realized later that _root etc. is actually as1 code
    from my days of Flash 5 :-)
    All I need is to know how to access a movieclip on the stage
    that was placed using the IDE from within a class, and how to
    access a class and call its methods from within another, and I can
    teach myself the rest...
    So, if I place something with the IDE, doesn't it show up in
    the display list? I should be able to control those elements, too,
    shouldn't I?
    Or do I have to use Actions rather than classes for those
    elements?
    I probably read 5 different articles/ebooks on the topic of
    classes and OOP in AS3 already, and none gave me the answer I
    needed.
    But I will have a look at the site you mentioned.
    Thanks!

  • Learning about classes

    Hi,
    I'm working my way through "The Java Programming Language, Fourth Editition" by Sun Microsystems. There are exercises through the book, but they don't give the solutions (which is helpful!!!).
    They show a simple class, then ask you to produce an identical one to keep track of vehicles. Based on their sample code this should be the code:
    class Vehicle {
         public int speed;
         public String direction;
         public String owner;
         public long idNum;
         public static long nextID = 0;
      }Then then ask you to write a class called LinkedList giving no coding examples 'that has a field type Object and a reference to the next LinkedList element in the list. Can someone help me to decipher what this means and the appropriate code?
    They then show how to create objects linked to the vehicle class, which based on their sample code should be
    Vehicle car = new Vehicle();
    car.idNum = Vehicle.nextID++;
    car.speed = 120
    car.direction = "North"
    car.owner = "Metalhead":
    This is the bit that next confuses me. They ask you to write a main method for your Vehicle class that creates a few vehicles and prints their field values.
    The next exercise is to write a main method for LinkedList class that creates a few objects of type vehicle and places them into successive nodes in the list.
    Is'nt it correct that the above code starting 'Vehicle car' would be the code used to create the object which would go in the LinkerList calling on the Vehicle method which has already been defined? For example, successive entries could be for bus, bike etc in the LinkerList. What does it mean though to place these into successive 'nodes' on the list? And why would you create vehicles in the main method of the Vehicle class. Shouldn't they just be created in the LinkerList?
    I'm only learning about classes and I'm confused already?
    Any help (and code) would be great!!!!
    Thanks for any help,
    Tim
    p.s. I know what I have written sounds vague, bu the book doesn't really give much extra helpful info.

    First of all, the variables of the "Vehicle" class should all be private.
    You should not be able to directly retrieve each variable from this class
    Example:
    Vehicle car = new Vehicle();
    car.idNum = Vehicle.nextID++;
    car.speed = 120
    car.direction = "North"
    car.owner = "Metalhead"You should have methods that can change this data as well as retrieve the data.
    Example:
    class Vehicle {
         private int speed;
         private String direction;
         private String owner;
         private static long nextID = 0;
            public Vehicle() {
                speed = 0;
                direction = "";
                owner = "";
                ++nextID;
            // These methods retrieve the attributes
         public int getSpeed() { return speed; }
            public String getDirection()  { return new String(direction);}
            public String getOwner() { return new String(owner);}
            public long getidNum() { return idNum; }
            // These methods change the attributes
         public int setSpeed(int i) { speed = i; }
            public String setDirection(String s)  { direction = new String(s); }
            public String setOwner(String s) { owner = new String(s); }
    }Now, they want you to create another CLASS that shows what your Vehicle class can do.
    Example:
    public class SomeRandomExampleClass {
        public static void main(String[] args) {
            Vehicle v1 = new Vehicle();
            // Now let's fix up our vehicle
            v1.setSpeed(100);
            v1.setOwner("Zeus");
            v1.setDirection("North");
            // Do note that since idNum is a static variable, it will be increased everytime you create
            // an instance of a Vehicle, and works with the class rather than the object.
            // For instance, if you create Vehicle's v1, v2, and v3, then v1's idNum = 1, v2's idNum = 2;
            // and v3's idNum = 3.
            Vehicle v2 = new Vehicle() ;
            v2.setSpeed(500);
            v2.setOwner("Ricky Bobby");
            v2.setDirection("NorthEast");
            System.out.println(v1.getSpeed()); // prints v1's speed.
            System.out.println(v1.getOwner()); // prints Owner
            System.out.println(v1.getDirection); // Prints Direction
            System.out.println(v1.getidNum());  // prints idNum
            System.out.println(v2.getSpeed()); // prints v1's speed.
            System.out.println(v2.getOwner()); // prints Owner
            System.out.println(v2.getDirection); // Prints Direction
            System.out.println(v2.getidNum());  // prints idNum
    }A linked list is what it sounds like. It can hold a list of (let's say vehicles) and you can print their
    attributes from there.
    For instance, let's say we have a list called list1.
    list1.add(vehicle1);
    list1.add(vehicle2);
    Then you can iterate(move) through your list and print the attributes of each vehicle, instead of having to
    call v1.doThis() v1.doThis(), v2.doThis().
    I find it amusing they want you to create a LinkedList when you are first using/learning classes.
    To understand how to create a linked list, you can visit:
    http://leepoint.net/notes-java/data/collections/lists/simple-linked-list.html
    Or you can use:
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedList.html
    *Note: I wrote the code from nothing so some of it could have syntax errors.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • General question about classes

    Hi every one,
    I have an application that works but i'll like to optimize it, regarding about speed and system ressources. For resume and represent diagrammatically the application I wrote, there is a first frame (the main menu) with severals buttons. When I push a button I show a new frame with a query resultset displayed inside.
    Theses second frames are all very similars, just a few things are differents between one and another (sql string of the query, and some controls may be visible or not).
    So there are many solutions to write it :
    1- I can make a class representing this second frame and each time I push a button from the main menu, I create a new Object with this class and when I quit this frame I do a "dispose" of it.
    2 - (the solution I got) I create an Object with the model of this second frame once and for all, and when I push a button I set visible this frame and call a method to change some parameters, when I quit the frame I set it hide.
    I think second option is not to bad and the first one is very heavy, but If I created a class B that extends my second frame A (that contains the main code for displaying results) and each time I push a button from the main menu I created an object from B type, is it a good idea ??
    Hope you understand my problem, and hope anyone will give me an idea...

    Hi rainek and ty for your attention,
    Yes you understood right :
    my app creates Frame 1 with buttons and show it, and I create on the background a raw version of Frame 2 shown, and with changed parameters when button is pressed.
    But I don't not extend Frame 2 with a SubFrame 2, I just wonder if it would be a good thing to create subframe 2 and instance it each time I push a button from Frame 1, instead to use the same Frame 2 raw version (storing it in a file config indeed) from the background. I wondered, if when I instance for the second time a subframe 2 it was speeder because an object subframe 2 as already been instancied before.
    You know my problem was also that when I created Frame 2 in the background before create Frame 1, it gave my troubles with Frame 1 display (cf. my topic :http://forums.java.sun.com/thread.jsp?forum=57&thread=231897), so now I create this frame 2 raw version the first time I push any button, but of course there is a litte big longer time answer this first time. (I thank too, to create Frame 2 raw version in a thread to avoid frame 1 display troubles)
    Hope I'm clear and you understand me, for resume in a generic problem, I wonder know if when i have this config :
    Frame 2,
    Subframe2 that extends Frame 2
    if i do
    Subframe2 myframe_a = new Subframe2 (<parameters_a>) and
    Subframe2 myframe_b = new Subframe2 (<parameters_b>)
    myframe_b is created more quickly because myframe_a as been instancied before
    Any way ty very much for your answer rainek !!

  • Question about classes/Directories

    I've been using Java to learn programming for a while now, so this question may not belong here. It seems to be more of a general question, however, not code related.
    How does java work with directories? Say I had a project, and for some reason I wanted different java class files to be in different directories. How does java handle this? Say for example:
    1.) Main class is in C:/blahblah/Project/ and the other classes were in C:/blahblah/Project/src/?
    2.) Main class is in C:/blahblah/Project/src/ and the other classes were in C:/blahblah/Project/?
    3.) Main class is in C:/blahblah/Project/src/ and other classes were in C:/blahblah/Project/bin/?
    I know these may be kind of stupid examples, but I just wanted to know how such things worked for future reference. Thanks a ton!

    {color:#3D2B1F}It sounds like you need to learn about packages: [http://java.sun.com/docs/books/tutorial/java/package/index.html] {color}

  • Learn about classes and perfom in abap

    hallow
    i wont to learn how to use classes and perform
    in abap, any document will help
    regards

    I will send you the documents...
    please give your mail address...
    it's good to here about ABAP OOPS.
    Regards,
    Jayant
    Please award if helpful

  • Question about classes hyargie

    hello, my english is very bad so, but i think you can understand my problem:
    i'm creating a game, in Java using jEdit and have 3 classes: one application with the static main, called Memory. That one creates another one, called Game. It's a canvas. Till here no problem.
    But when I try to create from the the class Game a class Kaart, he'll give an error:
    the code looks like this
    public class Game extends Canvas
    private Kaart kaartje;
         public Game( int dinges )
    kaartje = new Kaart( 27, 16 );
    add( Kaartje ); //<---------------------
    this is the error:
    C:\Jan\proggen\Game.java:34: add(java.awt.PopupMenu) in java.awt.Component cannot be applied to (Kaart)
              add( kaartje );
    ^
    1 error
    anyone know about this..?
    thanks jan

    What are you trying to do?
    The message says that you need to pass a PopupMenu to add (you are calling add on the Canvas). So, apparently, kaartje is NOT a PopupMenu (or subclass). What does Kaart look like?

  • Information about class files debugging information

    Hi,
    As known, when compiling "javac -g ..." the class files contain debugging information.
    my Naive question is WHAT is this information?
    could you please add any links to articles about this debugging information?
    Many thanks!!

    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#22856
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#5956

  • Question about class icons

    So I learned today that a child class's icon is created by merging the child's icon as displayed in the class properties with the parent's icon as it appears in the parent's properties (the child's icon being the top image in the merge and the parent's the bottom). This isn't obvious from normal operation since the default icons are the same size and thus the child's icon perfectly overlaps and thus displaces the parent's. However, I drew an icon that extends a little bit beyond the bottom of the border of where the default icon normally goes (in the parent icon). This change was propogated to my numerous child classes, and now the icon is cut off on like 100 vis and it looks dumb.
    Technically, this doesn't change anything about my program. Since I never actually place the child vi's on a block diagram, I never see the icons except when editing the child vis or when they are calling each other (one child vi calls the other, which is rare). The code is only brought into the main vi via dynamic dispatch. That said, I'd love to know if there is a way to override the default behavior of how labview builds these vi icons. It's driving the pedant in me crazy.

    Hi majoris
    could you post an example of this so I can look at it more closely?
    Joe Daily
    National Instruments
    Applications Engineer
    may the G be with you ....

  • Question about class PackedInteger.

    Dear All,
    i was searching for sth that can read an integer by using FileInputStream , i mean to take it in the form of an integer not bytes as usual , and i found this class called PackedInteger on that link :
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/util/PackedInteger.html#readInt(byte[],%20int)
    mm actually i'm not sure about the source of that class , or who published it , alsoo i'm not sure if it would be useful in my case ,
    can any body help me ?, if u have any ideas about how to read and write inetegrs from to files i would be grateful to hear from u .
    thanks in advance.
    Regards,
    D.Roth

    hey guys , i found this also , what do u think ?
    readUnary
    public int readUnary()
    Reads a unary integer from the already read buffer.
    Returns:
    the decoded integer
    , in a class called BitFile .

  • About classes and Inheritance

    hi every one,
    i want use class with object in data block and i want know how i can use inheritance with objects.
    becouse i have interview in this two subjects, can any body support my.
    thanks,,,,,,,

    Hello,
    Start Forms Builder, the press F1 to display the online help.
    In the search tab, you can type "Class Property" or "Object Library" to find documentation on those topics:
    About Property Classes A property class is a named object that contains a list of properties and their settings. Once you create a property class you can base other objects on it. An object based on a property class can inherit the setting of any property in the class that makes sense for that object. Property class inheritance is an instance of subclassing. Conceptually, you can consider a property class as a universal subclassing parent. There can be any number of properties in a property class, and the properties in a class can apply to different types of objects. For example, a property class might contain some properties that are common to all types of items, some that apply only to text items, and some that apply only to check boxes. When you base an object on a property class, you have complete control over which properties the object should inherit from the class, and which should be overridden locally. Property classes are separate objects, and, as such, can be copied between modules as needed. Perhaps more importantly, property classes can be subclassed in any number of modules.
    or
    Using the Object Library These topics contain information about using the Object Library in Oracle Forms: About the Object Library Removing an Object from the Object Library Creating a tab in the Object Library Deleting a Tab in the Object Library Saving an Object in the Object Library Opening an Object Library Module Displaying the Object Library Closing the Object Library Commenting Objects in the Object Library
    Francois

  • About Class Object  as Array

    Hello.. I'm beginner in Java Programming
    Now i learn about Array.. i'm not understand about use class object become array. for example i'm create class object Card.
    Then i call Card object to CardTest as main object and Card object called as array.
    can you tell me about how to work Card object as array in CardTest ?
    Edited by: 994075 on Mar 14, 2013 11:55 PM

    994075 wrote:
    yup..thanks guru :DI'm no guru, I just bought a decent Java book 10 years ago and here I am.
    so i guess Object Class can be array :).I don't get that statement. You can store objects in an array, if that's what you mean. An array itself is also an object.
    but i'm not understrand if static method in Card object can be called automatically when Card initialized in CardTest?a) research constructors
    b) you usually don't need static methods, its just something that people new to the language tend to overuse because then you don't have to create object instances. Forget about static methods, try to make it work using regular non-static methods.
    And you really should read and study more, you're coming to the forum way too soon. First get a solid knowledge base, the only thing you're doing now is asking questions that you could have answered for yourself by studying more.

  • Question about class design

    Hi:
    I am trying to design a web game using JSP, servlets, etc. I have some ideas about the classes I have to create and how to split the work among them. I.e:
    class Player
    - contains the player data like name, nickname, age, etc...
    - have a static method getPlayerById(id) which calls load(id) method.
    - load method calls DBPlayer.load(id)
    class DBPlayer
    - uses Database objetct to get the connetion.
    - static load(id) method executes a "select" query and gets the data from database and create a new Player instance sending the data by constructor
    class Database
    - get the connetion data and connect to database
    I could have a JSP page named showPlayerInfo.jsp which gets the player_id by request. The page calls Player.getPlayerById(player_id) ans shows the data in html format.
    would this be correct?
    If I would like to show the list of players of a game. Could I have a GamePlayerList servlet which uses Database object, get an array of Player objects which can be shown using a JSP page or the GamePlayerList servlet? should the "retrieving player list data" be in DBPlayer instead?
    Thanks in advance for your advices

    There is no right answer. What you have is a model object (Player) a data access object (DBPlayer, normally this would be named something like PlayerDao) and a utilities class to connect to the database (Database or you could call it DatabaseUtil or DatabaseHelper, whatever) Another option for your Database class is to instead call it AbstractDao, have PlayerDao extend it, and in AbstractDao place methods like connect(), rollback() and commit(). One reason you want these methods in either a helper class or a superclass is so you can place your try-catch blocks there and not have to worry about cluttering up the rest of your code.
    In terms of an overall architecture, you should take a look at the MVC pattern. Your Player and PlayerDao objects are your model. Your servlets are your controllers. And your JSP's are your view. It's a fairly standard way of organizing your application.
    You have several options for how to load new players. The first would be as you have done, to place a static factory method in Player. Another option would be to create a separate PlayerFactory object that can create new or return existing or delete existing players. The Servlet would call the PlayerFactory which would delegate to the PlayerDao returning a Player object. In this design, your Servlet would either invoke the PlayerFactory or PlayerDao to save, etc. If you instead want a bit more encapsulation at the price of separation of concerns, you can have the Player object itself have methods like save(), delete(), etc.
    There is no right answer. Designs involve trade-offs and to a large extent personal (or corporate or academic) preference.
    - Saish

  • I don't know what's wrong with my code. it's about class and object.

    * This is generic type of Person
    package myManagement;
    * @author roadorange
    public class Person {
    private String SS;
    private String firstName;
    private String lastName;
    private String middleName;
    private String phoneNumber;
    private String address;
    private String birthDay;
    public void setSS (String SS) {
    this.SS = SS;
    public String getSS() {
    return SS;
    public void setFirstName (String firstName) {
    this.firstName = firstName;
    public String getFirstName() {
    return firstName;
    public void setLastName (String lastName) {
    this.lastName = lastName;
    public String getLastName() {
    return firstName;
    public void setMiddleName (String middleName) {
    this.middleName = middleName;
    public String getMiddleName() {
    return middleName;
    public void setPhoneNumber (String phoneNumber) {
    this.phoneNumber = phoneNumber;
    public String getPhoneNumber() {
    return phoneNumber;
    public void setAddress (String address) {
    this.address = address;
    public String getAddress() {
    return address;
    public void setBirthDay (String birthDay) {
    this.birthDay = birthDay;
    public String getBirthDay() {
    return birthDay;
    public void Person() {
    SS = "1234567890";
    this.firstName = "abc"; //test the keyword "this"
    this.lastName = "xyz";
    middleName = "na";
    phoneNumber = "123456789";
    address = "11-11 22st dreamcity ny 11111";
    birthDay = "11-11-1980";
    public void print() {
    System.out.println("Display Database\n"
    + "Social Security Number: *********" + "\n"
    + "First Name: " + getFirstName() + "\n"
    + "Middle Name: " + getMiddleName() + "\n"
    + "Last Name: " + getLastName() + "\n"
    + "Phone Number: " + getPhoneNumber() + "\n"
    + "Address: " + getAddress() + "\n"
    + "getBirthDay: " + getBirthDay() );
    package myManagement;
    //this class is used to test other class or test other object
    public class testClass extends Person{
    public static void main(String[] args) {
    Person obj1 = new Person();
    obj1.print();
    System.out.println(obj1.getFirstName()); //test the object
    Result:
    Display Database
    Social Security Number: *********
    First Name: null
    Middle Name: null
    Last Name: null
    Phone Number: null
    Address: null
    getBirthDay: null
    null
    i don't know why it's all null. i assign something in the default constructor. it shouldn't be "null".
    does anyone know why?

    when you create 2 class using netbean editor, person.java and test.java
    i never compile person.java.
    when i finish typing these 2 class and i just right click test.java and run.
    my question is do i need to compile person.java before i run test.java directly??
    does Netbean compile it automatically when i run test.java first time?
    i add another constructor Person constuctor with one parameter in Person.java and create 2nd object to test the 2nd constuctor and run.
    All the codes work, so does the first default constructor. i don't why is that.
    Then i removed what i added and restore back to where it didn't work before and test again. it works.
    @_@. so weird.
    problem solved. thank you
    Edited by: roadorange on Feb 25, 2008 7:43 PM

  • MenuStrip and a Question about Class win32_product

    Hello,
    I have a bunch of questions I'm hoping someone can answer.
    1.) I would like to add a menu separator and a checkbox under a dropdownitem for a toolstripmenuitem
         Similar to what you would see in ISE or Internet Explorer.
         I then need to pass the state of this checkbox into a function
    2.) I have created a file menu item and would like to create a separator and then add a list of MRU items restricted to only displaying the five previous opened config files.
    3.) Can someone propose an alternative to using the get-wmiobject win32_Product class
    The below function I wrote to get the Product Version for some VMware products, but it is slow making the initial connection.   Looking at the Uninstall registry key won't work because it doesn't contain the product version.
    I know it looks odd.  I could not find a good way to detect which servers the products were installed on.   So instead I pass the servers that would host these products based on our build standards.
    Function get-version($vcenter,$sso,$vum,$credentials) {
    Write-Host "Getting Version information. This usually takes awhile. Be Patient " -NoNewline
    $Roles = "VMware vCenter Server","VMware vCenter Inventory Service","VMware vSphere Web Client","vCenter Single Sign On","VMware vSphere Update Manager","vSphere Syslog Collector"
    $i = 0
    $output = @()
    $Servers = "$vcenter","$vcenter","$vcenter","$sso","$vum","$vum"
    $ErrorActionPreference = 'silentlycontinue'
    ForEach ($input in $Servers) {
    IF ($psversiontable.psversion.major -ge 3) { Write-Progress -activity "Getting Version Information - Takes awhile. Be Patient." -status $Roles[$i] -PercentComplete (($i / $roles.Length) * 100) } Else { ticker }
    $object = New-Object PSObject
    $object | Add-Member NoteProperty "Role" $Roles[$i]
    $object | Add-Member NoteProperty "Hostname" $Servers[$i]
    $object | Add-Member NoteProperty "IP Address" (Get-WmiObject Win32_networkadapterconfiguration -ComputerName $Servers[$i] -Credential $credentials | ? {$_.IPEnabled} | Select-Object IPaddress).IPaddress[0]
    $object | Add-Member NoteProperty "Version" (Get-WmiObject win32_Product -ComputerName $Servers[$i] -Credential $credentials | Where-Object {$_.Name -eq $Roles[$i]}).version
    $output += $object
    $i++
    IF ($PSVersionTable.PSVersion.Major -ge 3) { Write-Progress -activity "Completed Getting Version Information" -Completed } Else { write-host "...Done!" -NoNewline }
    write-host ""
    $output
    } # End Function get-Version
    Walter

    Your code doesn't relay make much sense.
    What is this line for:
    $Servers = "$vcenter","$vcenter","$vcenter","$sso","$vum","$vum"
    Funtion get-version($vcenter,$sso,$vum,$credentials
    Why are you using credentials.  Only and admin can call remotely?
    Are you trying to get all of these roles? Aren't these produces?
    $Roles  = "VMware vCenter Server","VMware vCenter Inventory Service","VMware vSphere Web Client","vCenter Single Sign On","VMware
    vSphere Update Manager","vSphere Syslog Collector"
    ¯\_(ツ)_/¯

  • A question about class and interface? please help me!

    the following is program:
    interface A{
    public class B implements A{
    public static void main(String [] args){
    A a = new B();
    System.out.println(a.toString());
    }i want to ask a question, the method toString() is not belong to interface A, why a can call method toString()? the interface call the method that isn't belong to, why? please help me...

    because a.toString() call the method toString() of class Object because B implements A, but extends Object and in the class Object there is a method toString(). infact if you override the method toString() in class B, a.toString() call toString() in class B.
    try this:
    interface A {}
    public class B implements A
      public String toString()
        return "B";
      public static void main(String [] args)
        A a = new B();
        System.out.println(a.toString());
      }by gino

Maybe you are looking for

  • Need suggestion on new environment (server - database combi).

    Hello, We have two database instances (DB1 and DB2 - Both 10g) each of size 10TB. Currently, both the databases are mounted on same AIX server. There are several schemas in each database. There will be data transfer activity between two databases. Cu

  • Assign form field value

    Gurus: Given a value in form field one, I want to assign a value to form field two (same form). How can I accomplish this? Thanks in advance! kc

  • New Ram failed

    Hello, I have a Powerbook G4 1.67 GHz PowerPC G4 Memory: 512 MB DDR SDRAM I have just added another 512MB DDR 2100, SO-DIMM Memory Module by Kingston. After boot up the memory is not visable. When I veiw the hardware diagnostics the following info is

  • Mass t,code field name issue

    Hi In t.code massobj bus2105 purchase requisition in field list new entries object type bus2105,table name eban,field name ebakz, save it,then i check mass t.code bus2105 field name ebakz not coming,plz help Regards Sam

  • Emptying Trash takes ages ... :(

    Hello, I find recently that emptying my system trash takes a really long time ... Before, it used to be very quick with a noise of scrumpling up paper, now it just hangs and countsdown the item to be deleted super slow. I just upgraded to Lion but be