This program show me "int cannot be dereferenced" as error can you help me?
public class Factorial{
public static void main (String [] args){
if (args.length<1){
showmsg("a Integer Please");
else if (args.length>1){
showmsg ("Only a Integer please");
else {
int n;
try {
n= Integer.parseInt(args[0]);
catch (NumberFormatException nfe){
showmsg ("a Integer not a String please"); //call to chow message method
factorial(n);
//show a message
private static void showmsg (String texto){
System.out.println(texto);
//factorial procedure
public static void factorial (int n){
int fac=1;
for (int i=1;i<=n;i++){
fac*=i;
String resu = fac.toString();
showmsg(resu);
}
Thanks for your help, I did change other lines too... (if some body wish Run)
try {
int n;
n= Integer.parseInt(args[0]);
factorial(n);
catch (NumberFormatException nfe){
//call to show message method
showmsg ("a Integer not a String please");
showmsg (nfe.getMessage());
}
Similar Messages
-
Cannot open aperture v3 after upgrading to OS 10.6.8. Bought the upgrade online so cannot reload the software. Can you help?
How did you buy it online? Did you buy a registration number from the Apple Store?
Then you can download the Trial version from this link:
Aperture 3.1 Trial
and run Software Update immediately after installing.
Go to the Applications folder and delete Aperture.
Download the Aperture 3.1 Trial.
Open the Aperture Trial disc image.
Double-click the "Aperture Trial.mpkg" file.
Follow the onscreen instructions to install Aperture.
After the installation completes, choose Software Update from the Apple () menu.
Cannot open aperture v3 after upgrading to OS 10.6.8.
But what exactly is the error you get, when you try to launch Aperture? Maybe you need to do more than updating.
Regards
Léonie -
Since downloading IOS6 I cannot receive or send emails, can you help
Since downloading IOS6 I cannot receive or send emails, can you help
I've done that. But the settings "mail, contacts, calendar" are still disabled. For example, if I want to add a new mail account, I can not do it. Because the option "add account" is as if it's turned off, disabled, as well as my other accounts above this ...
The rest of the IOS6 everything worked out, but with the native Mail app is complicated ... -
I have iCloud successfully set up my Mac and iPhone iPad. Mac will not transfer to my other devices. Other devices transfer successfully. I have checked my iCloud setting on my Mac, but cannot see a problem. Can you help me?
If you have iTunes 11 on your computer then you can enable the left-hand sidebar on it via option-command-S on a Mac, control-S on a PC - when connected (and if your computer's iTunes is up-to-date) your iPad should then appear on that sidebar under a 'Devices' heading :
If you select the iPad on that sidebar you can then use the Movies tab on the right-hand side of the iTunes screen to select and sync that film to your iPad's Videos app.
Has your iPad been synced to the computer before ? If not then you might find this page for syncing to a new computer useful : https://discussions.apple.com/docs/DOC-3141 -
I am trying to connect my Apple TV to an older Panasonic projection TV using an HDMI to a DVI cable to the Digital IN. I cannot get any sound. Can you help?
DVI interface does't allow audio. Is there optical IN from your Panasonic TV? By then you can connect your ATV to Panasonic using optical together. It will work.
-
I have Geo Asian TV App on my IPad which was working fine before loading ios6. Now if try to run the video in this app, it says adobe reader or html5 required. Can you help
It may have used the YouTube app that is no longer included in iOS. Try downloading the YouTube app in the App Store and see if it works.
-
i have just updated my iphone 4 to ios5. i cannot find my photos anywhere can you help? Thanks
Hey Kate
if you have backed up your iPhone, photos that were taken on the iPhone will be in the back up file. Any photos synced to your iPhone from a computer will need to be synced again. To restore your iPhone from a back up right click on the name of your iPhone in iTunes and select restore from back up. -
Have downloaded Christmas screensaver from Hallmark. This Screentime media has to install and I keep installing but it still won't open, It is in my downloads and when I click on it it says to install and I do 4 times now and I still cannot get it to open. Can anyone help with suggestions. Very frustrating.
Thanks againThe ones I see from > screensavers Hallmark are for Windows OS only.
Maybe try some at > OS X Christmas Screensavers - Google Search -
Cannot get connected to itunes can you help
i cannot get connected to itunes on my ipad - can anyone help?
Are you talking about the calendar app? go to settings - general - reset - reset home screeen layout.
-
I would like to have my security questions reset I don't remember my answer for my favorite car. I just had a new computer set up because my xp was outdated
You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
(105121) -
I always had this browser next to file, edit etc. Now for the past day, that browser is gone I do not know how to bring it up again. Please help me.
You can try a couple of things:
Tap Settings > WiFi > and then the blue ">" next to the network name. Find "Renew Lease" and tap on that.
Tap Settings > Airplane Mode On. Wait a few seconds and turn it back off. -
YouTube would not open just spinning and telling me there is an error retry but it does not open. I deleted it and put it back still the same thing.can anyone help please? I am using an iPad
Hi Tavionval,
I apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having issues with the YouTube app itself crashing or not launching, you may find the troubleshooting steps outlined in the following article helpful:
iOS: An app you installed unexpectedly quits, stops responding, or won’t open - Apple Support
Regards,
- Brenden -
The banking sites usually prevent log-info from being saved, but there was a way around it..
i want to save them on my computer just like any other passwords..
i forgot the name and address of that add-onyou can use Lastpass Password Manager, its Safe and Free :)
* https://addons.mozilla.org/en-US/firefox/addon/lastpass-password-manager/ -
"int cannot be dereferenced" error.. help me please
I'm working with an array list class called PersonList and it uses attributes from a normal class called Person.
I would like to make this method PrintPerson inside the PersonList class that should search for a specific Person given the ID as parameter to the method. the method should print all info of the Person if found, otherwise a message saying id is not valid.
I solved it like this:
public void PrintPerson(int id)
System.out.println("Enter ID of the person ");
id = Stdin.readInteger();
//search the ID if it is in the List
int i=0;
while
((i<next)&&(!(list.getID().equals(id))))
i++;
//if found
if (i<next)
list[i].OutputWindow();}//display the object ouput of this ID
else{
System.out.println("The following ID: " id "is not valid!");
}//end if
}// end of method
my problem is with this code:
((i<next)&&(!(list.getID().equals(id))))
I get this error "int cannot be dereferenced"
what should I do? help me please
-- Mattlist.getID() == id
-
ERROR: int cannot be dereferenced
hi everyone i am trying to copmile the following code
public void refreshGUI() {
MessageBoardQueries MBQ = new MessageBoardQueries();
Date date = Calendar.getInstance().getTime();
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
String argDate = df.format(date).toString();
int pNumber = MBQ.queryPending(argDate);
int aNumber = MBQ.queryAccepted(argDate);
int dNumber = MBQ.queryDeclined(argDate);
pendingNumberField.setText(pNumber.toString());
acceptedNumberField.setText(MBQ.queryAccepted(argDate));
declinedNumberField.setText(MBQ.queryDeclined(argDate));
}but i keep getting the error:
int cannot be dereferenced on the line
pendingNumberField.setText(pNumber.toString());
does anyone know why?because int is a primitive datatype, hence doesn't inherit from java.lang.Object, and as such doesn't have a toString method
try Integer.toString(pNumber) or String.valueOf(pNumber). either is equally valid
Maybe you are looking for
-
Hello I had configured Office Web Apps for SharePoint 2013 which was working fine for about 2 months until this morning. The error message I get for WORD, PDF and Excel files is: The ULS logs on the WFE give me this: WOPI (CheckFile) Proof Data: Acce
-
My ipod touch shows up as a camera on my pc and wont show up at all on itunes
my ipod touch shows up as a camera on my pc and wont show up at all on itunes
-
Remove Windows 8 and Windows 7 INSTALLING in L4070 notebook LNV
Hello Bought a notebook model LNV L40-70 with Windows 8 makes. It is for business use and the programs that use the company does not run very well on Windows 8 and for that reason need to install Windows 7 on the notebook. The problem is that the bio
-
Adobe Audition CS6 (5.0.2) update patch released
Hey Audition friends! This morning we released an update patch for Adobe Audition CS6. This update, version 5.0.2 for Mac and Windows, fixes several bugs discovered after release that could not be fixed in time for the earlier patch, and cleans up a
-
Workbook not showing result in BI7 analyser
We have a workbook which executes and displaying results well in BW3.5, but not displaying output with BI7 Bex, showing as client is out of memory, I am using 2GB ram system , the same is the case with all BI7 Bex patches( till SP 5). Can anyone sugg