Help, still trying to get the basics of Java

OK, I'm still trying to figure out the basics and on this program decided to write small amounts of code at a time and compile them so I could learn where I was making the mistakes. I keep getting stuck I am getting 5 cannot find symbols on the following code. I've made sure I have imported the Scanner class, checked my brackets, but can't figure out why it is still giving these errors. Can you please help? Why will it not recognize "input"?
import java.util.Scanner;
public class Inventory
     public static void main( String args[] )
     String productNum = "";
     String name = "";
     int units = 0;
     double amount = 0;
     Scanner scan = new Scanner( System.in );
     System.out.println ( "Please enter product #" );
     productNum = input.next();
     System.out.println ( "Please enter color name" );
     name = input.next();
     System.out.println ( "Please enter units on hand" );
     units = input.nextInt();
     System.out.println ( "Please enter dollar amount for each unit" );
     amount = input.nextDouble();
     System.out.println (productNum, name, units, amount);
}

Doesn't it not mean that your AlbumInventory class does not define a constructor that takes zero arguments?
e.g
public class AlbumInventory {
     public static void main(String [] args) {
         AlbumInventory brokenInventory  = new AlbumInventory(); // This will produce compile error
         AlbumInventory workingInventory = new AlbumInventory(5098) // This will compile
     private int id;
     public AlbumInventory (int id) {
          this.id = id;
}

Similar Messages

  • Just trying to get the basics working...

    Hi,
    I have been trying to get just the basics working, and have spent almost all day, and now into the night, trying to get it to work....with no logical sucess.....
    All I am trying to do, using VB.net 2008 with Crystral Reports 2008, is to disply my report on a web page using the crystalreport viewer in Visual Studio.
    I created a report in CR2008, and during the process of creating the report I had to create a connection to the SQL Server 2005 database and set a parameter on my report to show the data for a single record from the database.
    The issue is that the connection string I use in CR2008 is NOT the connection string that is to be used in the browser, so the first task I have attempted to do is to set new log in details for the report. I just want to use a trusted connection.
    I have searched high and low on the internet, and taken a look at the samples provided on this site.
    My code, as it is at the moment for setting the connection for the report at run time is at the end of this email: ( I got this code from the samples on this site)
    The problem I have is if the integratedsecurity set to true(as I need it) then the myconnectioninfo.servername and database name are totally ignored. I have changed them to be just randon characters, which should result in the report not being able to connect, yet the report still works fine.
    No errors are generated at all, so its very confusing. I know the code is being executed via breakpoints and stepping through the code, but it would seem that it makes no difference.
    What am I doing wrong here.....
    Private Sub ConfigureCrystalReports()
            Dim reportPath As String = Server.MapPath("CrystalReport1.rpt")
            myCrystalReportViewer.ReportSource = reportPath
            Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
            SetDBLogonForReport(myConnectionInfo)
            myConnectionInfo.ServerName = "SQL1"
            myConnectionInfo.DatabaseName = "MPx
            ' myConnectionInfo.UserID = "limitedPermissionAccount"
            'myConnectionInfo.Password = "1234"
            myConnectionInfo.IntegratedSecurity = True
        End Sub
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            ConfigureCrystalReports()
        End Sub
        Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
            Dim myTableLogOnInfos As TableLogOnInfos = myCrystalReportViewer.LogOnInfo
            For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
                myTableLogOnInfo.ConnectionInfo = myConnectionInfo
            Next
        End Sub

    Hi,
    Couple of things:
    1) Please make sure that you are using CR2008 with SP0 at least. Dlls versions should be 12.0.2000.0 and File version 12.0.1100.0.
    2) Please make sure that the destination database can be accessed from that machine. You can create a UDL file or a new report hitting the target database to see if we can see data into it.
    3) Please make sure that we are not changing the schema of the report.
    4) Can you try this code mentioned below:
    ConnectionInfo crConnection = new ConnectionInfo();
                   crConnection.ServerName="Server";
                   crConnection.DatabaseName="DB";
                   crConnection.UserID="uid";
                   crConnection.Password="pwd";
                            crConnection.IntegratedSecurity=true;
                   crReport.Load(Server.MapPath("CrystalReport1.rpt"));
                   Tables crTables=crReport.Database.Tables;
                   foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                        TableLogOnInfo crTLOI = crTable.LogOnInfo;
                        crTLOI.ConnectionInfo=crConnection;
                        crTable.ApplyLogOnInfo(crTLOI);
                        crTable.Location=Database.Owner.Tablename
                   CrystalReportViewer1.ReportSource=crReport;
    Regards,
    AG.

  • Still trying to get the free PS CS6 upgrade

    I purchased a full version of PS CS5 Extended version about a month ago from GovConnection.  At purchase time, I was told that the purchase qualified me for a free upgrade for the CS6 version when it started shipping. I went to the Adobe site, registered the product and filled out the online form to see if I qualified.  I received an email message a few days later saying that I had qualified and that I should not contact Adobe again until they emailed me about how to redeem the upgrade.  I waited what I thought was a reasonable time (May 25th came and went) and tried to chat with a representative to see where my email redemption was. The representative said that they were going to open a case for me and that I should be hearing back in 1 or 2 days.  More time went by and still no response.  I re-contacted Adobe using the case number that I was given.  I received what looked like a boiler plate response with "Dear XXXXX" in the header and addressing me as "Susan" (I had signed my note with my name which is "Jim").  Long story short, I'm still without my upgrade, the trial version of PS CS6 that I downloaded is about to expire and I still don't have a CS6 serial # or product that I'm entitled to have.  What do I have to do to get Adobe to take some action on this?  Every representative that I've chatted with has had to escalate the issue to another tier and has not been able to resolve it.
    Thanks,
    -Jim

    Hi Quelch,
    BT Sport is delivered over BT Infinity and is only delivered over traditional broadband where BT Infinity is not available.
    Steve
    BT TV Expert
    I am a BT Employee and an expert on TV queries. I am here volunteering my own time to give advice, primarily on the BT Vision+ and YouView boxes. Go here for more info.
    If my post has been helpful, please click on the Ratings star on the left-hand side of the post.

  • Hello i am trying to help a friend to get the update for the mac os x maverick and msg pops up saying distribution file not verified

    hello i am trying to help a friend to get the update for the mac os x maverick and msg pops up saying distribution file not verified

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • HT2534 I followed the instructions on how to set up an Apple ID without using a creditcard or iTunes card many times on several devices, but I still do not get the NONE option on the billing page. Please help??

    I followed the instructions on how to set up an Apple ID without using a creditcard or iTunes card many times on several devices, but I still do not get the NONE option on the billing page. Please help??

    Follow the steps on this page when creating a new account http://support.apple.com/kb/HT2534
    e.g. if using a computer's iTunes : https://discussions.apple.com/message/24321860
    If you've already created an account and are being prompted to review it when trying to see it then you could see if this post by mountaingoatgirl lets you do so without needing to enter credit card details : https://discussions.apple.com/message/24303054

  • I am trying to download a book on my ipad. It says I need to install itunes. I have itunes already. I frequently get a message to re-install itunes. I do, but I still get the message, and I still can't get the book on my ipad.

    I am trying to download a book on my ipad. It says I need to install itunes. I have itunes already. I frequently get a message to re-install itunes. I do, but I still get the message, and I still can't get the book on my ipad.

    you can download a new installer and serial number from Adobe at Adobe - CS2 Downloads

  • Help Please! I am trying to get the 7232 DVR

    I have been trying to get the 7232 DVR since installation.
    My Triple Play was installed on 12/23/2011 and I was given NO DVR.
    I was told I needed to go to the neaest store to get my DVR. At the store they told me they did not have the 7232 but gave me an older DVR, the only one they had in stock but I should call customer service to get the 7232 DVR.
    I called customer service and they said I could only order the 7232 online. I ordered it online around 1/1/2012. Ticket NJDQ026S1V
    I called customer service today and they have no idea where I am in the waiting list and how long it will take.
    I don't think it si fair that since the installer made a mistake that I get stuck with an old DVR.
    Please tell me what I can do
    Thank you for your help 

    The installer did not make a mistake. Installs are done with available equipment. The installation tech likely did not have that box. That ticket you referenced did not show ordering a box. The 7232 can not be ordered on the phone. It must be ordered online. Please follow these steps...
    Go to www.verizon.com/fiostvcentral 
    Sign In
    Select the “FiOS TV” Tab
    Select “Settings”  sub-listing
    Select “Set Top Boxes” from the drop down list
    Select the “Go” button under “Want more from your FiOS DVR.”
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • HT5373 How do I enable a calendar subscription in my iCloud calendar? I'm using a Windows laptop (Home Office 7) and am trying to get the rugby and footfall fixtures to appear on my iCloud calendar.  Thanks for your help.

    How do I enable a calendar subscription in my iCloud calendar? I'm using a Windows laptop (Home Office 7) and am trying to get the rugby and footfall fixtures to appear on my iCloud calendar.  Thanks for your help.

    I suspect you had the same issue I did and downloaded the 64-bit version of the OpenSC libraries, but your firefox is 32-bit. You can see the opensc-pkcs11.dll in the System32 folder via windows explorer, but when you browse that directory via firefox to add the module, you are acutally being redirected to the SysWOW64 directory. Try intstalling the 32-bit OpenSC libraries, and adding the appropriate library from the C:\Windows\SysWOW64 directory.

  • HT201442 I did this but still i am getting the same error , please help me .

    I did this but still i am getting the same error , please help me .
    <Email Edited by Host>

    Look at http://support.apple.com/kb/ts4451
     Cheers, Tom

  • I am not able to sync some videos and apps onto my iphone 3gs. it shows a sync error: 0xe8008001.i updated it but still i am getting the same sync error problem..please help.

    i am not able to sync some videos and apps onto my iphone 3gs. it shows a sync error: 0xe8008001.i updated it but still i am getting the same sync error problem..please help.
    aman

    Are you using Windows...?

  • I have been trying to get the full version of lightroom after using a trial version but it says something about "GB" ? And i need to log into different account or set up a new one? Please help?

    I have been trying to get the full version of lightroom after using a trial version but it says something about "GB" ? And i need to log into different account or set up a new one? Please help?

    I would love to give you more information but i cannot access that page again? i can add Lightroom to my cart but when i go into my cart it says there is nothing in there? I have a red bubble above "my cart" with a number 4 in it to show there is something there but there is not? It just wont let me buy anything?

  • M trying to add a printer to my extreme network however i only get the basic airport utility screen when I click on airport utility ??? Am I going crazy

    m trying to add a printer to my extreme network however i only get the basic airport utility screen when I click on airport utility ??? Am I going crazy

    OS X Mountain Lion: Set up a printer to print wirelessly
    OS X: Connecting a Wi-Fi printer to your Wi-Fi network

  • I'm trying to get the ios 4.2.1 on my second generation iPod . Is there a way to install it directly on my iPod touch because my iTunes on my computer is not working. Please help Apple! I need the update. Just give me a link.

    Im trying to get the ios 4.1.2 on my iPod touch 2nd generation. Can I install it directly on my iPod . My iTunes on my computer isn't working!

    you have to have itunes installed but check out http://support.apple.com/kb/ht4623.

  • HT1373 i have a broken desktop which had my itunes account on it. I am trying to get the information onto a new laptop and itunes programme but cannot. I also cannot get my iphone 5 to be recognized on the new itunes. HELP

    i have a broken desktop which had my itunes account on it.
    I am trying to get the information onto a new laptop and itunes programme but cannot. I have only managed to copy over some of my music as i had it on an external drive.
    I also cannot get my iphone 5 to be recognized on the new itunes.
    HELP

    iTunes as you see it in the application window uses a series of files and folders contained in the iTunes folder.  Some people make the mistake of only backing up their media in which case all you have is a bunch of media files without the iTunes structure.  In that case you have to build a new library yourself.
    What exactly do you mean "not recognized"?  The phone does not show up on the computer at all, or it does but it says it will wipe the phone?  The wipe the phone stuff is again because it cannot find the original library to which it was synced.  You need to transfer the entire iTunes folder from the old computer or the backup you made of it.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391

  • Still trying to get unconfused about drives

    Coming from the Mac world and using a MBP and external storage, all this talk of drives, raids, etc. is making my head spin!
    I know that I will be backing up extensively and can handle the downtime/risk of losing a days data (I'm compulsive about syncing my work on backups as I make progress), so I'm probably going to be avoiding raid since I will likely have 4 drives to start with.
    I'm going to have 1 x Crucial M4 256gb SSD for OS/Programs and most likely (3x) seagate barracuda xt 2tb drives in addition.
    So my first question is, should I be looking at also getting a small SSD for media cache/page files, or am I fine putting this onto a regular harddrive? If I do the latter, should the harddrive have a partition for the page files/cache to help with speed? How big are these files typically? Should I reserve the entire 2tb drive for them?
    I've read through the disk guide, but being a newb to a lot of this I'm still trying to get my head around it.
    So far I think I want:
    1. SSD for os/programs
    2. Drive for page files/media cache (what else goes on here?)
    3. Drive for media/input
    4. Drive for export
    Which drive should my project files go on again?
    Any help clarifying this is much appreciated! When everybody starts taking the math of throughput my head begins spinning still. I'm starting to gain a tiny bit of understanding, but I'm trying to still keep it really simple for myself right now, as I'm building my first workstation and this is only one of many technical concerns I'm currently wrapping my head around!

    should the harddrive have a partition for the page files/cache to help with speed?
    Partitions do not help speed. On the contrary, it reduces speed but increases wear and tear. Compare it to a large loft you have to store your stuff. You can easily walk around your loft and get the stuff you need. That is comparable to a non-partitioned disk. Now imagine that same loft, but partioned into two or more parts with a wall and a door to separate the parts. You have stuff stacked against the wall you need, so you get it, but instead of getting the other stuff you need just  1 foot behind it, you have to walk 12 feet over to the door, open it, walk 12 feet to the other stuff you need, return 12 feet to the door, close it and then go about your thing.  You have just walked 36 feet, where without those partitions 1 foot would have sufficed. Not very efficient, right? Same with partitioning your disk.
    The basic thought on where to put what, is to distribute disk accesses across as many disks as you have. If you have a workflow where you export only a few times, or once when finished, then put your projects and exports together. Remember that SATA is half duplex, so you can only read at one time and write at another time. You can't do both at the same time. When exporting the project is already loaded, the media need to be read and written to the export disk.

Maybe you are looking for

  • Select query in not working for Count(*)

    Hi, Our batch team running one query that is selecting one table TSFHEAD and this query is hanging. Below are diffrent shenario in which the select query is running on this table. select * from tsfhead where create_id = 'BATCH' and create_date = '26-

  • Slide with no audio playing audio

    I'm using Captive 4. My intro slide has no audio, yet when I publish and view the SWF, it plays two key clicks. I set that slide to stop the background audio (even though there is none) and I still hear the clicks. Any help with getting this to stop

  • OMJJ - Where I diferentiate "Stock quality inspection" -  "Stock unrestricted use"?

    Good morning, experts! I need to know how to set up a move for the input material in quality stock, without having to use the QM or configure the material. We have the standard movement 503 that is received at the stock in quality inspection and the

  • ERROR: Release '640' is not supported by this tool!

    Hi, i'm trying to upgrade system SAP ERP 5.0 to SAP ERP 6.0 EHP 4 and i got problem with EHP installer, 1. I readed and made all the steps as described in Upgrade guide 2. Downloaded EHP installer version 7.00 (but when it starts shows me on screen v

  • How to make a "secondary" iCloud account my "primary"

    When I migrated from mobileme I logged in with my mobile me account and migrated to iCloud which opened up my "primary icloud" account (me.com) on my IMAC this was back in Oct.  After I was certain that all the bugs had been worked out of Icloud I th