Ok so i was wondering what im doing wrong here
i have one driver class and 2 objects that im trying to read into it. the RightArrow and LeftArrow compile but the demo class gives me these errors
F:\ArrowDemo1.java:25: setTail(int) in RightArrow cannot be applied to ()
RightArrow.setTail();
^
F:\ArrowDemo1.java:29: setArrowheads(int) in LeftArrow cannot be applied to ()
LeftArrow.setArrowheads();
^
F:\ArrowDemo1.java:30: setTails(int) in LeftArrow cannot be applied to ()
LeftArrow.setTails();
^
4 errors
what am i doing wrong here.
public class ArrowDemo1
public static void main(String[]args)
Scanner keyboard = new Scanner(System.in);
System.out.println("Do you want your arrow to point right or left");
System.out.println("Type right or left");
String rightLeft = keyboard.nextLine();
if (rightLeft.equalsIgnoreCase("right"))
RightArrow.setArrowhead();
RightArrow.setTail();
if (rightLeft.equalsIgnoreCase("left"))
LeftArrow.setArrowheads();
LeftArrow.setTails();
public class LeftArrow extends Figure
Scanner keyboard = new Scanner(System.in);
private int base;
private int head;
private int tail;
public void setArrowheads(int headsUp)
System.out.println("Please enter a head length for your arrow");
headsUp = keyboard.nextInt();
if (headsUp < 1)
System.out.println("Sorry the head length must be larger than 0");
System.exit(0);
if (headsUp >= 3)
int oddTest = (headsUp%2);
if (oddTest == 0)
System.out.println("Sorry you must enter an odd number of 3 or higher");
System.exit(0);
head = headsUp;
public void setTails(int tail)
System.out.println("Please enter a tail length for your arrow");
tail = keyboard.nextInt();
if (tail < 1)
System.out.println("Sorry the tail length must be larger than 0");
System.exit(0);
public class RightArrow extends Figure
Scanner keyboard = new Scanner(System.in);
private int base;
private int head;
private int tail;
public void setArrowhead(int heads)
System.out.println("Please enter a head length for your arrow");
heads = keyboard.nextInt();
if (heads < 1)
System.out.println("Sorry the head length must be larger than 0");
System.exit(0);
if (heads >= 3)
int oddTest = (heads%2);
if (oddTest == 0)
System.out.println("Sorry you must enter an odd number of 3 or higher");
System.exit(0);
head = heads;
public void setTail(int tails)
System.out.println("Please enter a tail length for your arrow");
tails = keyboard.nextInt();
if (tails < 1)
System.out.println("Sorry the tail length must be larger than 0");
System.exit(0);
tail = tails;
}
duffymo wrote:
How do you ever expect to understand Java when you can't read English?
Did you read the error messages?This is one of the things that frustrates me the most. People see an error message, and they freak out. "OMFG! I don't know enough Java to understand these mysterious runes! I need to find someone to tell me what magic spell to type (since programming is, of course, all about memorizing what to type) to make it go away!"
I know some of the messages are kind of cryptic, but many of them--this one being a prime example--are very explicit if you just take a few seconds to read it. Are people so bloody afraid to even try to engage their brains? Does nobody even have the most basic concept of observing a problem, taking a moment to study what's happening, using a tiny bit of knowledge, logic, and guesswork to come up with a potential solution or two, and then trying it out? Is everybody really so fuckityfucking helpless? Is simple analysis a lost art, doomed to go the way of [Damscus steelmaking|http://en.wikipedia.org/wiki/Damascus_steel]?
</rant>
Edited by: jverd on Mar 29, 2008 12:56 PM
Similar Messages
-
Hi I have the old photo shop elements 10 on my computer and want to update and was wondering what the differences between photoshop, lightroom and photoshop elements are?
Also when I upgrade does it have to be with a monthly membership or can I just purchase the product out right like you use to be able?You cannot "update" from what you have to any of the applications you mention. It will have to be a straight purchase or subscription at full price.
Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.
Lightroom is all about volume, and very light editing.
The Photoshop Elements forum is at:
https://forums.adobe.com/community/photoshop_elements/content
Remember, you are not addressing Adobe here in the user forums. You are requesting help from volunteers users just like you who give their time free of charge. No one has any obligation to answer your questions.
I do not know where there is such a comparison table as you seek, but someone else might, or you can google. -
I bought this older MACBOOK PRO 15.4" 1.83 GHz with 2gb of RAM and Leopard 10.5 on eBay for real cheap because I don't have the money to buy a new one like I would like to do, and it comes with a disk to upgrade the OS to 10.6 and I was wondering what all I can and should upgrade (short of the whole computer) as I have the money to do so? Or did I just get really hosed?
You have the original Core Duo model. 2 GBs is the most RAM you can install, so the only thing you could upgrade would be the hard drive. Doing so is not a trivial task but you can find suitable hard drives and installation tutorials at OWC.
Since yours is a Core Duo model you can upgrade OS X to Snow Leopard, but not to Lion which requires a Core 2 Duo or better. -
I use Time Machine to back up my entire computer with my external hard drive. I am getting a brand new iMac this month and was wondering what is the process of using this back up to restore my new computer exactly how my old computer was? I want to make sure I will still have various important files on my new computer, like my songs in iTunes, my photos in iPhoto, etc, etc. Thanks so much in advance!
Welcome to the Apple Support Communities
When you turn on the new iMac for the first time, Setup Assistant will ask you to restore a backup, so connect the external disk and follow steps to restore all your files to your new iMac. Your new Mac will have the same settings and programs as your old computer.
In other cases, I would recommend to restore the whole backup without using Migration Assistant or Setup Assistant, but a Late 2012 iMac uses a special OS X build, so the OS X version that you're using on your old Mac won't work on the new one. For more information, see > http://pondini.org/OSX/Home.html -
When viewing multiple item information, I was wondering what the checkboxes next to "Artist", "Album Artist", etc... are used for.
When checked, it means that you are going to apply whatever is in the box to all of the selected items.
-
I am using os x 10.4.11 on a 2.4 ghz intel core 2 duo. I don't believe I can install lion on this system but was wondering what is the highest version I can use?
Here are the requirements for Lion:
http://osxdaily.com/2011/06/07/mac-os-x-10-7-lion-system-requirements/
In order to install Lion you have to have Snow Leopard and then update to 10.6.8:
http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
Personally I suggest that you stop at Snow Leopard. It still is the most efficient OS that Apple has devised and it still works great. Go to the Lions only if there are feature that you really need. There may be a price to pay in slower performance though.
Ciao. -
Hello friends
I was wondering what version of xcode may be installed on a powerpc PowerBook G4 laptop with Mac OS X 10.4.11. What version would work on it? Where may I find it? I use the X11 package a lot.
Thanks a lot!You can download it for free from the Apple Developer Connection web site, but you have to have a membership. Go to this page:
http://developer.apple.com/products/
Scroll down to the bottom of the page and the bottom right choice is the free online membership. Once you're signed up, you can log in and Download the Xcode tools. There will probably be several to choose from, including Xcode 3 and Xcode 2.5, so make sure you get the right one. -
I am trying to make an in app purchase, but it keeps asking me to contact iTunes support to complete the transaction. I was wondering what i do?
You contact iTunes support.
-
I was wondering what i may do because when i FaceTime my girlfriend it hangs up when she answers
i was wondering what i may do because when i FaceTime my girlfriend it hangs up when she answers
From the article.
"FaceTime for Mac version 1.0.5 or later for Mac OS X v10.6"
http://www.idownloadblog.com/2014/04/23/apple-releases-fix-for-facetime-on-older -versions-of-os-x-ios-6-still-seeing-issues/ -
My i phone was stolen and I was wondering what the exact thing to do is! Also how can i send an email to apple to tell them to lock my phone permanantely?? Helpp!!
Check this out https://discussions.apple.com/docs/DOC-3362, thanks to Kappy. Contact your carrier, they would be the only one that could possibly blacklist your phone, if they provide that service.
-
I have the AppleCare and was wondering what i have do to get a new phone since I drop and cracked the screen on this phone. What do I have to bring the store when I go in?
ThanksIf you have AppleCare+, for the $49 filing fee, you can use one of your two allowed accidental damage claims. You must turn in an intact iPhone to be eligible (it can, of course be damaged, but all the parts need to be there).
Otherwise, nothing in Apple's warranty covers accidental damage. The accidental damage claim is a special insurance rider only with AppleCare+, allowing two claims, with the associated fee each time.
All you need is the broken phone - they will pull everything else they need off their system from the serial number and your info. -
I have a late 2009 iMac, with the default Nvidia 9400 Graphics card.
I was wondering what my options are for upgrading. I use Windows 7 via Bootcamp, so I need a card that is compatible/has available drivers.
This is for gaming. On the lowest settings of "Call of Duty 4", I get about 100 FPS... Was hoping to be able to play on higher resolution w/o the fps lag.
I'm not good with the hardware part of computers at all, but know how to get around the OS.In most cases the graphics cards in iMacs are Not upgradeable. They are usually soldered to the logic board. RAM is considered, along with harddrives, the only component that is upgradeable in an iMac, unlike in PC's. So basically you would need to sell your unit and purchase an iMac with a more powerful graphics card.
Hope this helps -
Hi everyone!
I was wondering what OS9 is for? Is it something I can delete if I never use it or will it cause complications?MacOS 9/Classic support for each PowerPC G3, G4, and G5-based Mac
http://www.everymac.com/systems/by_capability/macs-that-support-macos-9-classic. html
Mac OS X: What is a Classic Application?
http://support.apple.com/kb/TA20902
Do Classic applications work with Mac OS X 10.5 or Intel-based Macs?
http://support.apple.com/kb/HT2253
"Classic Mode" indicates a system can run MacOS 9 applications within the MacOS X "Classic Environment" provided with MacOS X 10.4.11 Tiger and lower. Apple provides no support for MacOS 9/Classic applications on any Intel-based Macs or on PowerPC-based Macs running MacOS X 10.5 Leopard or higher.
If you don't need or use OS 9, you can drag the System Folder (OS X is in a folder named System) containing OS 9 to the Trash & empty trash. You may free up approx 200-300MB of hard drive space.
Cheers, Tom -
I have recently purchased a new macbook air I was wondering what the "other" represents in the flash storage?
Everything that cannot be classified in one of the other categories.
-
I was wondering what student plan included Premier and After Effects
Hi, I was wondering what student plan included Premier and After Effects? It seems not to say anywhere...
CamillaThe Cloud has three plans:
Full (all apps including Premiere and AE)
Single App
Photography Plan
The Full Cloud includes the software listed here
Explore Adobe desktop apps | Adobe Creative Cloud
So you can either subscribe (at student rate instead of full rate) to 2 x Single App plans (Pr + AE) or a full Cloud plan and get all apps
Maybe you are looking for
-
Looking for Keyence Instrument driver for LV.
Looking for instrument driver for LV developed for the Keyence LS-7500 series micrometer. Has anything seen any or done this already? Any help would be greatly appreciated. BTW I have already checked NI's listing of instrument drivers to no success.
-
Hi, I could use some help creating a CBT in flash - I would like to have different links and use a controller (template built) to create an easy way to navigate from page to page. Thing is, I don't know where to start!! I used one of the templates th
-
Can I use imessage with an apple ID which is not connected to any iphone / iPad ?
Hay dude. I have just upgraded to Mavericks in my macbookpro. I have used an apple ID to log in to my imessage. That Apple ID is not connected to any iphone/iPad. Can I still use that apple ID to use my imessage feature and send free message to my fr
-
UoM issue due to multiple backend systems
Hi All, We have multiple backend systems hooked up with the SRM system. One issue that we have is that many of the UoMs are different in the backend systems. For example, for THOUSANDS, we have TH and THO in different systems. As part of optimization
-
Api to interact with a Thumbprint Reader
Hi, I have become interested in developing an application that uses a thumbprint reader and I was wondering if there is an Api or set of java classes that I can use to develop this application in java. Any directions would help.