Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010
    Posts
    18
    Rep Power
    0

    Default internel classes in java

    how to do this in java language?
    public enum ChessPieceColor
    Java Code:
    {
        White,
        Black
    }
    
    public enum ChessPieceType
    {
        King,
        Queen,
        Rook,
        Bishop,
        Knight,
        Pawn,
        None
    }
    i did that already but then after that look at this how do i do this?
    Java Code:
    internal sealed class Piece
    nternal ChessPieceColor PieceColor;
    internal ChessPieceType PieceType;
    how do i u7se an internal class in java?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default

    An example:

    Java Code:
    public class Outer {
       public static class Nested { ... }
       public class Inner { ... }
       void aMethod() {
          class Local { ... }
          JButton b= new JButton("test");
          // an anonymous class
          b.addActionListener(new ActionListener() {
             public void actionPerformed(actionEvent ae) { ... }
          });
       }
    }
    The example shows the different forms of classes: static nested, just nested (an inner class), a local class and an anonymous class.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Java Classes
    By qspiders.java in forum Introductions
    Replies: 0
    Last Post: 06-17-2011, 11:42 AM
  2. Java-Classes, what am I doing wrong?
    By Mattedatten in forum New To Java
    Replies: 3
    Last Post: 03-15-2010, 04:54 PM
  3. How to run java classes?
    By crunchybear in forum Advanced Java
    Replies: 7
    Last Post: 10-20-2008, 10:57 AM
  4. abt java classes
    By colbay in forum New To Java
    Replies: 1
    Last Post: 07-11-2008, 04:12 PM
  5. Running java classes with XML
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 06-29-2007, 03:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •