I am having problems getting this code to work.

public class Polar {
     public static void main(String[] args) {
          int angle;
          int distance;
          int x1;
          int y1;
     public Polar (int angle, int distance, int x1, int y1) {
          this.angle = angle;
          this.distance = distance;
          this.x1 = x1;
          this.y1 = y1;
     public void printIt() {
          System.out.println(" Angle " + this.angle);
     //int new x1() {
     //     return 1;
this part below, the instructor couldn't get to work and he was going to try to figure out what was wrong.
     /*public int newX(int angle; int distance; int x1; int y1) {
          return (int) (distance * Math.cos(toRadians(angle)));
     public int newY(int angle; int distance; int x1; int y1) {
          return (int) (distance * Math.cos(toRadians(angle)));
I'm getting the error messages that it can't find the symbol variable for angle, distance, x1 and y1 on lines 13 thru 19. I also have to figure out a loop to make it do points 10 times.
Can anyone help me figure out what I'm doing wrong?
TIA

amerintconcepts wrote:
Whoa! When I added that other coma and went back and compiled I got this:
--------------------Configuration: PolarTest - JDK version 1.5.0_06 <Default> - <Default>--------------------
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:13: cannot find symbol
symbol : variable angle
location: class Polar
this.angle = angle;
^
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:14: cannot find symbol
symbol : variable distance
location: class Polar
this.distance = distance;
^
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:15: cannot find symbol
symbol : variable x1
location: class Polar
this.x1 = x1;
^
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:16: cannot find symbol
symbol : variable y1
location: class Polar
this.y1 = y1;
^
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:19: cannot find symbol
symbol : variable angle
location: class Polar
System.out.println(" Angle " + this.angle);
^
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:28: cannot find symbol
symbol : method toRadians(int)
location: class Polar
return (int) (distance * Math.cos(toRadians(angle)));
^
C:\Documents and Settings\Vicki\Desktop\Student Files\PolarTest\src\Polar.java:33: cannot find symbol
symbol : method toRadians(int)
location: class Polar
return (int) (distance * Math.cos(toRadians(angle)));Oh, that's because you've put all those variables in your main method, rather than as fields of the class, which is what you meant to do. Compilers never lie!

Similar Messages

  • Need help getting this code to work

    I am trying to get this code to work using "if else statment" but it will only do the first part and not do the second part in the else statement. Can anyone help me out? Here is the code:
    var R1 = this.getField("Registration Fees1");
    var R2 = this.getField("Registration Fees2");
    var R3 = this.getField("Registration Fees3");
    var R4 = this.getField("Registration Fees4");
    var R0 = 0
    if (R0 == 0)
      event.value = Math.floor(R1.value);
    else
      event.value = Math.floor(R2.value + R3.value + R4.value);
    I did notice that if I fiddled around this this part:
    if (R0 == 0)
    sometimes I can get the second part to work but not the first. I need it to do either or and this is getting frustrating.
    I might also not even need "var R0 = 0". I put that there for the condition part. If that is what is causing the problem, I can take it out. But then what would the condition be? For this form, the default is 0 and then the calculation follows by user clicking on different prices. The first part is if they want to pay for the full conference and the second part is if they want to pay for either Monday, Tuesday or Wednesday or 2 of the 3 days. Is it possible to get this to work with both parts together? I am still stuck on getting just one or the other working. Any help would be greatly appreciated. Thanks in advance.

    I have posted this on another message board and a user by the name of gkaiseril offered this solution but it hasn't worked either.
    // all four days
    var R1 = this.getField("Registration Fees1").value;
    // Monday
    var R2 = this.getField("Registration Fees2").value;
    // Tuesday
    var R3 = this.getField("Registration Fees3").value;
    // Wednesday
    var R4 = this.getField("Registration Fees4").value;
    var Fee = 0
    event.value = ''; // default value
    if (R1 != 'Off') {
      Fee = Number(R1) + Fee;
    } else {
      if(R2 != 'Off') {
         Fee = Number(Fee) + R2;
      if(R3 != 'Off') {
         Fee += Number(R3);
      if(R4 != 'Off') {
         Fee = Number(R4) + Fee;
    event.value = Fee;

  • Hello, i am having problems getting face time to work, I keep getting an error message saying the server could not process the registration, I am using the username and password I always have and it has always worked in the past, any ideas?

    Hello, i am having problems getting face time to work, I keep getting an error message saying the server could not process the registration, I am using the username and password I always have and it has always worked in the past, any ideas?

    We aren't Apple, just users like you volunteering to help other users with problems. Threatening to go to Samsung doesn't mean anything to us. What troubleshooting have you tried so far?

  • Anyone else having problem getting promo code for $100 gift card??

    This is ridiculous.  I upgraded from an LG chocolate touch to the Thunderbolt and still have NOT gotten my promo code for $100 gift card.  Is this happening to anyone else?  I've called customer service to no avail.  I'm supposed to get a clal back this Sunday to see if the code came through yet.  This is the only reason I upgraded right now.  I am not a happy customer. 

    We upgraded my daughter's LG ENV3 to an Iphone on 08-18-11.  The salesman told us we'd be getting a promo code in 5 days by email or SMS.  Still hadn't seen it by the middle of September so we started calling customer service.  Over several hours, we spoke to five different people and received five different reasons why we either would get the code or wouldn't get the code, ranging from we didn't quality (false) to your email is rejecting the code that we've sent numerous times (also false). We were told that they could give us the code over the phone, but that particular person didn't know how and then we were told that the code could never be given over the phone.  I finally walked into the Verizon store where I bought the Iphone and got the manager on the case.  It took him 2 days talking to multiple people in Verizon, who I as a mere paying customer could not contact on my own, to finally get someone who was willing to send the code again (or was it being sent for the first time?).  That problem solver somewhere in the bowels of Verizon told me on Friday, Sept. 30th that I should be getting the email any minute and to keep checking and he would call me on Monday, Oct 3rd to make sure I received it (Big surprise he never called back on Monday).  On Saturday, Oct 1st I still hadn't received the email to either of the email addresses that he said he was sending it to so I started checking the boards here and realized that I was not alone in my misery. I took somebody's suggestion and sent a PM to on of the customer service people on this forum, explaining in detail my problem and still haven't received a response from her.  Needless to say, Daisy at Verizon won't be receiving any Kudos from me.  FInally, on Monday night I received an SMS with a working code  that was accepted by the trade-in website.  Hopefully, I get my $100 but I won't hold my breath.  I've been with Verizon for years and currently have five phone on my account.  I've had a variety of customer service experiences with them over the years, some very good and some not so good, but this $100 gift card has been a real eye opener in customer service ineptitude. 

  • I cannot get this code to work...

    This code is annoying me to no end. I cannot seem to get it
    to work. I can get it to work, but all of my buttons disappear,
    along with everything else. EXCEPT, it keeps my home button, and
    makes two of them.... Now,I have no idea why, but help would be
    VERY appreciated.
    <SCRIPT language=JavaScript>
    dCol='404040';//date colour.
    fCol='0000FF';//face colour.
    sCol='FF0000';//seconds colour.
    mCol='000000';//minutes colour.
    hCol='000000';//hours colour.
    ClockHeight=30;
    ClockWidth=30;
    ClockFromMouseY=100;
    ClockFromMouseX=200;
    //Alter nothing below! Alignments will be lost!
    d=new
    Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
    m=new
    Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTO BER","NOVEMBER","DECEMBER");
    date=new Date();
    day=date.getDate();
    year=date.getYear();
    if (year < 2000) year=year+1900;
    TodaysDate=" "+d[date.getDay()]+" "+day+"
    "+m[date.getMonth()]+" "+year;
    D=TodaysDate.split('');
    H='...';
    H=H.split('');
    M='....';
    M=M.split('');
    S='.....';
    S=S.split('');
    Face='1 2 3 4 5 6 7 8 9 10 11 12';
    font='Arial';
    size=1;
    speed=0.6;
    ns=(document.layers);
    ie=(document.all);
    Face=Face.split(' ');
    n=Face.length;
    a=size*10;
    ymouse=0;
    xmouse=0;
    scrll=0;
    props="<font face="+font+" size="+size+"
    color="+fCol+"><B>";
    props2="<font face="+font+" size="+size+"
    color="+dCol+"><B>";
    Split=360/n;
    Dsplit=360/D.length;
    HandHeight=ClockHeight/4.5
    HandWidth=ClockWidth/4.5
    HandY=-7;
    HandX=-2.5;
    scrll=0;
    step=0.06;
    currStep=0;
    y=new Array();x=new Array();Y=new Array();X=new Array();
    for (i=0; i < n; i++){y
    =0;x=0;Y
    =0;X=0}
    Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
    for (i=0; i < D.length; i++){Dy
    =0;Dx=0;DY
    =0;DX=0}
    if (ns){
    for (i=0; i < D.length; i++)
    document.write('<layer name="nsDate'+i+'" top=0 left=0
    height='+a+' width='+a+'><center>'+props2+D
    +'</font></center></layer>');
    for (i=0; i < n; i++)
    document.write('<layer name="nsFace'+i+'" top=0 left=0
    height='+a+'
    width='+a+'><center>'+props+Face+'</font></center></layer>');
    for (i=0; i < S.length; i++)
    document.write('<layer name=nsSeconds'+i+' top=0 left=0
    width=15 height=15><font face=Arial size=3
    color='+sCol+'><center><b>'+S
    +'</b></center></font></layer>');
    for (i=0; i < M.length; i++)
    document.write('<layer name=nsMinutes'+i+' top=0 left=0
    width=15 height=15><font face=Arial size=3
    color='+mCol+'><center><b>'+M+'</b></center></font></layer>');
    for (i=0; i < H.length; i++)
    document.write('<layer name=nsHours'+i+' top=0 left=0
    width=15 height=15><font face=Arial size=3
    color='+hCol+'><center><b>'+H
    +'</b></center></font></layer>');
    if (ie){
    document.write('<div id="Od"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < D.length; i++)
    document.write('<div id="ieDate"
    style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+pro ps2+D+'</B></font></div>');
    document.write('</div></div>');
    document.write('<div id="Of"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < n; i++)
    document.write('<div id="ieFace"
    style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+pro ps+Face
    +'</B></font></div>');
    document.write('</div></div>');
    document.write('<div id="Oh"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < H.length; i++)
    document.write('<div id="ieHours"
    style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+ hCol+';text-align:center;font-weight:bold">'+H+'</div>');
    document.write('</div></div>');
    document.write('<div id="Om"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < M.length; i++)
    document.write('<div id="ieMinutes"
    style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+ mCol+';text-align:center;font-weight:bold">'+M
    +'</div>');
    document.write('</div></div>')
    document.write('<div id="Os"
    style="position:absolute;top:0px;left:0px"><div
    style="position:relative">');
    for (i=0; i < S.length; i++)
    document.write('<div id="ieSeconds"
    style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+ sCol+';text-align:center;font-weight:bold">'+S+'</div>');
    document.write('</div></div>')
    (ns)?window.captureEvents(Event.MOUSEMOVE):0;
    function Mouse(evnt){
    ymouse =
    (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
    xmouse =
    (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
    (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
    function ClockAndAssign(){
    time = new Date ();
    secs = time.getSeconds();
    sec = -1.57 + Math.PI * secs/30;
    mins = time.getMinutes();
    min = -1.57 + Math.PI * mins/30;
    hr = time.getHours();
    hrs = -1.575 + Math.PI *
    hr/6+Math.PI*parseInt(time.getMinutes())/360;
    if (ie){
    Od.style.top=window.document.body.scrollTop;
    Of.style.top=window.document.body.scrollTop;
    Oh.style.top=window.document.body.scrollTop;
    Om.style.top=window.document.body.scrollTop;
    Os.style.top=window.document.body.scrollTop;
    for (i=0; i < n; i++){
    var F=(ns)?document.layers['nsFace'+i]:ieFace
    .style;
    F.top=y + ClockHeight*Math.sin(-1.0471 +
    i*Split*Math.PI/180)+scrll;
    F.left=x
    + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
    for (i=0; i < H.length; i++){
    var HL=(ns)?document.layers['nsHours'+i]:ieHours.style;
    HL.top=y
    +HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
    HL.left=x+HandX+(i*HandWidth)*Math.cos(hrs);
    for (i=0; i < M.length; i++){
    var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes
    .style;
    ML.top=y+HandY+(i*HandHeight)*Math.sin(min)+scrll;
    ML.left=x
    +HandX+(i*HandWidth)*Math.cos(min);
    for (i=0; i < S.length; i++){
    var
    SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds.style;
    SL.top=y
    +HandY+(i*HandHeight)*Math.sin(sec)+scrll;
    SL.left=x+HandX+(i*HandWidth)*Math.cos(sec);
    for (i=0; i < D.length; i++){
    var DL=(ns)?document.layers['nsDate'+i]:ieDate
    .style;
    DL.top=Dy +
    ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
    DL.left=Dx
    + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
    currStep-=step;
    function Delay(){
    scrll=(ns)?window.pageYOffset:0;
    Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
    Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
    for (i=1; i < D.length; i++){
    Dy=Math.round(DY
    +=(Dy[i-1]-DY)*speed);
    Dx
    =Math.round(DX+=(Dx[i-1]-DX
    )*speed);
    y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
    x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
    for (i=1; i < n; i++){
    y=Math.round(Y
    +=(y[i-1]-Y)*speed);
    x
    =Math.round(X+=(x[i-1]-X
    )*speed);
    ClockAndAssign();
    setTimeout('Delay()',50);
    if (ns||ie)window.onload=Delay;
    </SCRIPT>

    That is a problem with the Speed Dial extension.
    See [[Troubleshooting extensions and themes]]

  • Having problems getting Comcast internet to work with my power Mac running 10.5.8  Help needed

    Just got Comcast Cable and everything works: phone, WiFi, and TV, BUT ethernet won;t work with my power mac tower running 10.5.8 . Hooked modem to laptop running Microsoft and no problem, but it won't work with my Mac.  Any solutions out there?

    Hi, see if this changes anything...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.5, 10.6, 10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x/10.8.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    If using Wifi/Airport...
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    (There may be better or faster DNS numbers in your area, but these should be a good test).
    Click OK.

  • Anyone having problems getting Photoshop CC14 to work with Lightroom 5.5?

    I installed Photoshop CC 2014, but Lightroom wouldn't export photos to it. Spent 3hours on the phone with Adobe support, they wiped all my Adobe apps without warning me and I lost all my presets. Was told higher level support would contact me - didn't happen. System still not fixed, even after an hour trying to get to the right person today. I've never had a problem installing before - anyone else having a similar issue? Who do I contact for better "customer service" (or does it exist)?

    Hi David_B,
    Thanks for your reply! I've installed PS many times (since version 3, I think), and nothing like this has ever happened. I use and teach PS and LR for a living. The tech person I spoke with told me it is not unusual to have this happen when upgrading to CC 2014.
    What happened is that PS CC2014 would not open the image in PS if I used the Photo>Edit In>PS 2014 command unless I used Photo>Edit In>Open as Smart Object. Once opened as a smart object, PS would not save the file. I think it said Error 2.
    The tech took control of my computer, removed PS and LR and all the associated files a few times. He told me I'd have to have a high level person help me, but they didn't call me, so I phoned in. After waiting an hour to get to the correct person (not a high level tech) he said he'd have to uninstall everything again and start over and that it would take over an hour. I don't have the time right now to fix it as I'm headed out of town until the end of the month to teach LR.
    In the meantime, LR works, but I'm using a trial version that expires in 30 days. It exports to PS ok, but I had to reload all my plug-ins, and apparently LR can't find Photomatix. LR is not installed in my usual applications folder - the tech put it on my system backup drive.
    My case number is: 185696477
    Thanks so much for your willingness to help!
    Terry

  • :( I Just can't get this code to work (Help plzzzz)

    I was assigned a final exam project, but most of the stuff we never actually saw in class, so I just have to figure it out for myself.
    The part I'm stucked in (among other stuff) is:
    room = new JLabel[4];
    selec = new JRadioButton[4];
    roomg= new ButtonGroup();
             for(int i = 0; i < 4; i++) {
                  room[i] = new JLabel(arean);
              selec[i] = new JRadioButton();
              selec[i].addActionListener(this);
              areap.add(room[i]);
              areap.add(selec[i]);
              roomg.add(selec[i]);
              areap.setBorder(new TitledBorder(""+arean[i]));
    This part of the code successfully created a group of JRadioButtons each with the names previously established in arean[ ]. However, I'm supposed to make it so that whenever I press any of the RadioButtons, the border of the JPanel changes as well. As it is, Java will put only the last name, and won't change it as I click the different JRadioButtons.
    I'm not sure if I made myself clear, so if anyone is interested in helping me and needs further information, plz let me know.
    Thanks in advance.
    Message was edited by:
    SmaSh_

    If it's an array of Strings of area names, then the
    append to an empty string in this line of code:
                  areap.setBorder(new TitledBorder(""+arean)); is extraneous (as
    well as being a nasty idiom anyway, IMHO). I see
    that you removed it in your example...
    I agree that the empty string is a nasty idiom (hence my removal of it).  I figured arean had to be an array of Strings, if it is passed to the JLabel constructor (because toString on an Icon would probably be usely).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I am trying to connect my Sony DCR-TRV350 to iMovie so that I can make DVD's from family videos.  I am having problems getting the video camera connected.  Any advice on how to do this?

    I am trying to connect my Sony DCR-TRV350 to iMovie so that I can make DVD's from family videos.  I am having problems getting the video camera connected.  Any advice on how to do this?

    What happens when, after you connect your cam, you go to File > Import Media?
    But before that, does your cam require you to export your video files upon USB connection? I have a JVC Everio HD and I have to "Export to Library" from the cam's menu first-thing. This was true even in prior iMovie versions.

  • I am having problems gettting my mail to work ... Mac telling me that my start up disk id full and to delete some files to free up space ... have done this but when i open mail from the dock it just brings up the colour wheel and nothing happening

    I am having problems gettting my mail to work ... Mac telling me that my start up disk id full and to delete some files to free up space ... have done this but when i open mail from the dock it just brings up the colour wheel and nothing happening ... it shows when you right click on the mail icon that " application not responding"

    If your hard drive is getting full, you need to free up, at least, 20 GBs of space on your iMac's hard drive.
    If your Mac is running a fairly recent version of OS X, here are some general guidelines.
    Follow some of my tips for cleaning out, deleting and archiving data from your Mac's internal hard drive.
    Have you emptied your iMac's Trash icon in the Dock?
    If you use iPhoto, iPhoto has its own trash that needs to be emptied, also.
    If you use Apple Mail app, Apple Mail also has its own trash area that needs to be emptied, too!
    Other things you can do to gain space.
    Delete any old or no longer needed emails and/or archive to disc, flash drives or external hard drive, older emails you want to save.
    Look through your Documents folder and delete any type of old useless type files like "Read Me" type files.
    Again, archive to disc, flash drives, ext. hard drives or delete any old documents you no longer use or immediately need.
    Download an app called OnyX for your version of OS X.
    When you install and launch it, let it run the automatic ans S.M,A.R.T. tests,  then go to the cleaning and maintenance tabs and run the tabs that have the ability to clean out all web browser cache files, web browser histories, system cache files, delete old error log files.
    Typically, iTunes and iPhoto libraries are the biggest users of HD space.
    move these files/data off of your internal drive to the external hard drive and deleted off of the internal hard drive.
    If you have any other large folders of personal data or projects, these should be archived or moved, also, to the optical discs, flash drives or external hard drive and then either archived to disc and/or deleted off your internal hard drive.
    Good Luck!

  • HT1206 Lots of info about one user using multiple computers. What about multiple users with separate Apple IDs using same computer? Having problems getting my wifes new iPhone talking to her apple account on the computer we share (2 users)

    Lots of info about one user using multiple computers. What about multiple users with separate Apple IDs using same computer? Having problems getting my wifes new iPhone talking to her apple account on the computer we share (2 users)

    You need to create a user account for your wife (or yourself depending on who has the current user account). When syncing, each of you should sign in as a separate user, login to iTunes and then sync. I had this problem when my sister got an iPhone. When we did her initial sync, everything on my iPhone showed up on hers. Apple gave me this solution.

  • I'm running iTunes 10.5 on my Macbook Pro and software 4.1 on my 2g iPod touch and having problems getting photo's to sync. Same error iPod can't be synced req'd file can't be found. Tried deleting the photo cache, restoring the iPod etc but to no avail.

    I'm running iTunes 10.5 on my Macbook Pro and software 4.1 on my 2g iPod touch and having problems getting photo's to sync. Same error, "iPod can't be synced req'd file can't be found". Tried deleting the photo cache, restoring the iPod etc but to no avail.

    Try here:
    iTunes: Unable to sync photos
    Usually deleting the iPod Photo Cache Folder works. Note that if you sync via the folder method, make sure you dlete all the ifolders since :
    The iPod Photo Cache stores the photos that are optimized for display on your iPod, iPad, or iPhone. The location of this folder depends on the syncing options you select. In iTunes, if you change the selection in the “Sync Photos From” pop-up menu, a new iPod Photo Cache folder will be created (and the previous folder will remain).

  • What's the problem in this code

    import java.lang.reflect.*;
    import java.awt.*;
    class ABC
         public Integer i;
         ABC()
         public void setInt(Integer t)
              i = t;
    public class SampleName {
    public static void main(String[] args)
    ABC g1 = new ABC();
    g1.setInt(new Integer(10));
    printFieldNames(g1);
    static void printFieldNames(Object o) {
    Class c = o.getClass();
    Field[] publicFields = c.getDeclaredFields();
    for (int i = 0; i < publicFields.length; i++)
    try {
    Object ref = publicFields.get(c);
    System.out.println(" ref.toString() : " + ref.toString());
         }catch(Exception e)
                   e.printStackTrace();
    What is the problem with this code,at run time Iam getting this exception
    java.lang.IllegalArgumentException: object is not an instance of declaring class
    How can we get the value of field of an object

    Now it got this exception
    java.lang.IllegalAccessException
    at java.lang.reflect.Field.get(Native Method)That's strange - I didn't! ;-)
    Are you running exactly the same code as the code you posted (except for the one line I said to change)?

  • Since installing LION having problems getting photo images to upload?

    since installing LION having problems getting photo images to upload? anyone else havie this problem? I did finally get a message that the format was wrong, but I have changed nothing on my camera. Only change was the installing of LION.

    This is from the Kodak site which says there is no Lion compatible driver/software yet, but it is coming in late August:
    http://support.en.kodak.com/app/answers/detail/a_id/41646/kw/os%20x%20lion/selec ted/true
    If you don't want to wait there is always this kind of device for less than $10 (I don't own or endorse it):
    http://www.walmart.com/ip/Moultrie-USB-2.0-SD-Card-Reader/14972138

  • Having problems getting podcast on iTunes, tried to resubmit and got an already submitted error

    Having problems getting podcast on iTunes, tried to resubmit and got an already submitted error. How can I get the podcast on iTunes?

    You didn't need to get it removed: you can make any changes to a feed that you want, changing, adding or deleting episodes, and iTunes will pick them up.
    However, in the present situation you have fallen over a bug in the submissions process. The workaround is changing the title; as this hasn't worked you need to change the feed URL if possible, and also you could change the contents of the 'link' tag.
    If you can't get it sorted you could try emailing Support at podcasts 'at' apple.com and asking them to reinstate you (give them all the details) - their responses are a bit variable, but they may help you.

Maybe you are looking for

  • Audio is not working in dv6-2150us entertainment notebook

    The audio in my laptop is not working in last 2 days,i tried all possible ways,i downloaded and installed the audio driver for this particular model from hp site,but not working.Please help me to resolve this issue.

  • How can I reset the Apple ID on my iphone to match my correct Apple ID?

    When I pull up my Apple ID on my computer and log in to itunes, it has the correct Apple ID; however, the Apple ID on my iphone is still linked to an inactive email address. Help!

  • Error while creating Subcontracting PO

    Hi experts,        While preparing PO with item category "L".error meassage is displayed   -  " The MRP parameters are not maintained in plant "      I want to know which MRP parameters are to be maintained for Plant to create a Subcontracting PO and

  • How to create a schema file

    Hello Everyone I am new to Live Cycle. I am trying to get to know how live cycle works. I want to get a schema file how do i create that. i have a pdf form which i just imported in workbench and when i am trying to define a xfa variable where do i ge

  • Error in running sun portal server 7.2 on windows platform

    I have downloaded portal-7.2-windows-x86.zip Extract it at C:\ Run C:\PS7.2\setup.bat Opened: http://localhost:8080/portal/dt The following error was displayed: type Exception report message description The server encountered an internal error () tha