Constructor method, Can you easily solve the issue?
I have had many problems intergrating a constructor method into my program. This is my first time programming in java, can someone please help me. I have contructed a class for an airplanelisttester, that allows the user choice to add or remove planes from the program using a switch method, i have yet to program each "case" accordingly, but i am having trouble at the start of the code. I need to create an "airplanelist" object, i have found some help on the internet, but i am not sure what is going wrong.
public class AirplaneListTester
public static void main (String[] args)
throws java.io.IOException
char choice;
int size;
size = EasyIn.getint();
AirplaneList plane = new AirplaneList();
plane.add(Airplane) = "Add a plane?";
plane.remove(int) = "Remove a plane?";
plane.isEmpty() = "Is Empty";
plane.isFull() = "Is Full";
plane.getitem(int) = "Airplanenumber";
plane.getTotal() = "size" ;
public AirplaneList
private boolean add(Airplane);
private boolean remove(int);
private boolean isEmpty();
private boolean isFull();
private int getitem(int);
private int getTotal();
//..............rest of the program using swtich comands to alow the user to add\remove an airplane , check if a list is empty or //full and display the list as well as exit the program.
}
ok so it should look a little like this? I am not really sure, on how to create these objects? ;-<. I understand that "isEmpty" and "isFull" should bounce back very obvious boolean statements, i.e. isfull or isempty. However I am not sure on what values to initiate for "add(Airplane)" ? Is that null? or should i prompt the user to enter one?
import javax.swing.JOptionPane;
public class AirplaneList
public static void main (String[] args)
throws java.io.IOException
char choice;
int size;
size = EasyIn.getint();
AirplaneList plane = new AirplaneList();
plane.add(Airplane) = "Add a plane?";
plane.remove(int) = "Remove a plane?";
plane.isEmpty() = "Is Empty";
plane.isFull() = "Is Full";
plane.getitem(int) = "Airplanenumber";
plane.getTotal() = "size" ;
//declaration
private boolean add(Airplane);
private boolean remove(int);
private boolean isEmpty;
private boolean isFull;
private int getitem(int);
private int getTotal;
//constuctor
public AirPlaneList
add(Airplane) = null;
remove(int) = null;
isEmpty = true;
isfull = false;
getitem(int) = size;
getTotal = null; //initialisation
//methods
public boolean isFull()
return isfull;
public boolean isEmpty()
return isEmpty;
//..............rest of the program using swtich comands to alow the user to add\remove an airplane , check if a list is empty or
//full and display the list as well as exit the program.
}
Similar Messages
-
I had Iphoto 08 and now is gone, I have looked under applications and is not there. Also most of the pictures are gone. Can you easily delete the application?
Obviously you can.
To re-install iPhoto
1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
2a: On 10.5: Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
2b: On 10.6: Those receipts may be found as follows: In the Finder use the Go menu and select Go To Folder. In the resulting window type
/var/db/receipts/
2c: on 10.7 they're at
/private/var/db/receipts
A Finder Window will open at that location and you can remove the iPhoto pkg files.
3. Re-install.
If you purchased an iLife Disk, then iPhoto is on it.
If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
If you purchased it on the App Store or have a Recent Mac you can find it in your Purchases List. -
Please assist. My new iMac with latest operating platform by APPLE will not play Adobe on Safari. ESPN.com, as example, has articles that have videos attached. The error message pops up that I must upload / update ADOBE. I do that, but it does not resolve the issue. APPLE believes that the program should be deleted, removed from the Mac, and then re-uploaded via Adobe Technical Support. Can you assist? Thanks. Bob
Hi novibob,
Are you referring to Adobe Flash Player here.
Please refer the KB Doc: http://helpx.adobe.com/flash-player/kb/troubleshoot-games-video-audio-flash.html
Regards,
Rave -
Some Photos in the Facebook not displayed, can any one solve the issue?
Some photos not displayed in the Facebook, can anyone help?
Restart your Mac then try Facebook.
If that doesn't help, empty your browser cache then try again. -
Can you easily scratch the back of the iPad mini with your fingernails?
I have a iPad mini with retina display and I'm worried that my fingernails might scratch the back.
It is probably possible but I would think unlikely. The back is made of aluminum which could get scratched but I don't think your nails could do it. Neither my iPad nor my wife's iPad have ever gotten scratched from our use.
-
hi i have updated the 8.1 in my i phone 4s . then i got in my home screen i tunes and charging symbol only . its not getting on . can you help me out to solve the issue with my phone ?? thanks.
Hi vijayanandhtkp,
It sounds like you are getting the Connect to iTunes screen as discussed in this article.
If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support
If so, please check out this article as linked from there.
Use iTunes to restore your iOS device to factory settings - Apple Support
Thank you for using Apple Support Communities.
Nubz -
I can't seem to get my iMac (late 2009 model) into automatic sleep mode. If I manually put it into sleep I don't have any issues.
I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion. I now want to fix the underlying problem.
I'm not running any weird background processes and in my energy saver settings I've tagged "put the hard disk to sleep when possible:, "allow power button to put computer to sleep" and "automatically reduce brigthness". All pretty standard.
Is there anyone who can give me some pointers ?Today I solved the same problem for my iMac running Snow Leopard. See https://discussions.apple.com/thread/3008791#15947706. The method may help you, too.
For me it was the DynDNS Updater preventing my iMac from automatically entering sleep mode.
To my knowledge the cause of this sleep problem can only be a peripheral device or a process. So I suggest to first unplug all peripherals and test whether that's the cause. If not, I suggest to terminate one process after another and to test automatic entering of sleep mode after each. Start with user processes; continue with system process if necessary.
At least that's the way I found the offending process. Fortunately, I was able to change the configuration of that process to allow again automatic entering of sleep mode.
Good luck! -
A computer illiterate friend created 3 accounts on his iPhone 5 but forgot the passwords. He can't reset the password as his yahoo address is no longer valid. Erasing the phone doesn't solve the issue as the Apple server identifies the hardware as registered. How to register the phone with Apple?
I helped him create a new email address and new iCloud account on my Mac but when we try to register the phone with Apple it says: Maximim accounts limit reached for this device. How can he register the phone? I read different threads and found out that only Apple care can do that. We're in Romania and don't know where to call. Any suggestions on how we fix this?When I checked the support site for Romania, you apparently don't have an Apple Care contact center. You "may" try calling the US Apple care number to verify the account and have the password reset sent to a different email address. 800-694-7466
-
I can't get Apple Tv to sync. I have opened a port (3689) for itunes sharing but it has not solved the issue. Any ideas?
do you mean sync or shared lib?
because unless you have the old silver alu appletv with a harddisk sync is not possible at all -
Can anybody explain what is support for ADF Project and to solve the Issues
Hi,
I am new to ADF and i am currently associated to ADF Support Project.
Can anybody explain what is support for ADF Project and to solve the Issues when the ADF Project is in Live.
we are getting the Tickets for the Issues.
Thanks in advance.I agree with Timo.
It depends on the size of the project, user base, technologies, etc. We use lot of technologies in fusion middleware stack. We get tickets in many areas.
In your case, it could be anything like user training issues (user may not know how to use the some system features), browser issues like blank screen, bugs in code like JBO errors (failed to validate, another user has changed row, failed to lock the record, NullPointerException, IllegalArgumentException etc), business logic issues, page may not render properly, performance issues, partial commit issues, application server issues, authentication issues. If you use web services you might get web services related problems. -
y iPad2 is frozen, I am trying to download the upgrade software but fails after a while, how can I solve the issue. I have not upgraded the iPad 2 since I bought it.
Try and force iPad into Recovery Mode:
1. Turn off iPad
2. Connect USB cable to computer; leave the other end alone
3. Press and hold the Home button down and connect the docking end of cable to iPad
4. Continue holding the Home button until you see the "Connect To iTune" screen
5. Release the Home button
6. Open iTune
7. You should see "iTunes has detected an iPad in recovery mode"
8. Use iTune to restore iPad
Note: You need to be patient and repeat the above many times to recover your iPad -
hi, i installed ios 5 for my iphone 4 and the camera function on lock screen was on the first few days , now it doesn't show the lock screen . is there any change i can do . Pls help me to solve the issue.
nishaadp wrote:
... it stucks with the apple logo , nothing works. Is anything i can do?
See Here for
Frozen or unresponsive iPhone -
I'm trying to sync a new iphone into i tunes. I'm getting a message that says that this iphone cannot be used because the apple mobile device service is not started. Any idea what I can do to solve this issue?
See Here...
AMDS for Windows
http://support.apple.com/kb/TS1567
AMDS for Mac
http://support.apple.com/kb/ht1747 -
iPad can't get past step 8 when syncing. I have to unplug before the end. Is this normal? What do I do to solve the issue? Thanks. JD
It is syncing through everything and then failing to close out. If I disconnect then the libraries are all there although I have lost a movie and a few tracks downloaded as a result of this.
JD -
How do I solve the issue of this message "you do not have enough access privileges for this operation" on my iTunes? I already went to the folder of iTunes inside the Finder and change all permissions to allow read and write... no improvement at all. Any help? thanks!
Hi! I just realized I have two folders called library, one is inside HD alongside with System and users, then I have also "library" inside users, some of the folders are apparently repeated, some are missing. And all the music is inside a folder called iTunes Music, inside Music, inside users. Now that I relaized some folders are repeated I applied to all related to iTumes r/w permission. But the annoying message keeps coming on.
And yes, I am using Leopard, 10.5.8.
Any ideas?
Maybe you are looking for
-
Add multiple effects to a title and to a video
I have an edited video and inserted a title before the video starts. I would like to have the title zoom and while zooming, fade in. I apply the zoom to the begining of the title on my timeline, edit the duration and the start and end size then try t
-
I recently upgraded from an 80 to 160GB Classic but only some of the artwork in iTunes is synching. There was no problem with the old 80Gb classic. any suggestions?
-
On my mac I have a pixel grid when I zoom in over 500%, but on my PC (both using CS5) I dont have the option of pixel grid under view>show. Does this have something to do with the video card in my PC & selecting 'open GL' under edit.preferences? Than
-
Can you share Notes via Family Share?
We rely heavily on the Notes feature for keeping track of our To Dos and would like to share them via Family Share. Is that possible?
-
Kernel panic "ip_output: mix of packet in packetlist is wrong"
About once a week, my MacBook Pro running 10.5.1 kernel panics with this message: panic(cpu 1 caller 0x0023FA51): "ip_output: mix of packet in packetlist is wrong=0x30bd6900"@/SourceCache/xnu/xnu-1228.0.2/bsd/netinet/ip_output.c:1488 I'm diligently s