Need Help on getDeclaredFields of Class

Discussion in 'Java' started by manzur, Aug 18, 2006.

  1. manzur

    manzur Guest

    I have a class SnapShot.java

    public class SnapShot{
    private Double bal;
    private Double avg;

    public addBal(Double bal){
    Some Code
    Switch(bal.intValue){

    case1:do something
    case2:do something
    case3:do something
    }
    }



    }


    I am interested in getting the fields.So i did like this
    Class theClass = SnapShot.class;
    Field[] fields = theClass.getDeclaredFields();
    for (int i = 0; i < fields.length; i++) {
    System.out.println("fields:::"+fields);
    }

    The output should be display only two fields.but it is displaying three
    fields.It is taking switch as also instance variable

    thanks in advance
     
    manzur, Aug 18, 2006
    #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. E11
    Replies:
    1
    Views:
    4,788
    Thomas Weidenfeller
    Oct 12, 2005
  2. christopher diggins
    Replies:
    16
    Views:
    756
    Pete Becker
    May 4, 2005
  3. manzur
    Replies:
    3
    Views:
    697
    Thomas Hawtin
    Aug 20, 2006
  4. =?Utf-8?B?Q2hyaXM=?=

    Help Help. I really need some help with this

    =?Utf-8?B?Q2hyaXM=?=, Jan 31, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    568
    =?Utf-8?B?SmFzb24gVmVybWlsbGlvbg==?=
    Jan 31, 2007
  5. Joseph Turian
    Replies:
    5
    Views:
    597
Loading...

Share This Page