Hello, how can i get this code working?

public class TrivialApplication
public static void main(String args[]){
class HelloObject
String greeting="String Test";
void speak()
System.out.println(greeting);
?

At a guess I'd say it wouldn't like that because you've defined the class HelloObject inside main.
Try like so (formatting is done with [ code ] and [ /code ] tags):
public class TrivialApplication
    private String greeting;
    public static void main(String[] args)
        TrivialApplication ta = new TrivialApplication();
        ta.speak();
    public TrivialApplication()
        greeting = "String Test";
    public void speak()
        System.out.println(greeting);
}This is a bit of overkill, I certainly could have done it with less code, but it shows the standard format. How you declare variables, and initialise them in the constructor. How to create an object and call methods of the object.
Or, if you really wanted the HelloObject class...
public class TrivialApplication
    public static void main(String[] args)
        HelloObject ho = new HelloObject();
        ho.speak();
    class HelloObject()
        private String greeting;
        public HelloObject()
            greeting = "String Test";
        public void speak()
            System.out.println(greeting);
}HTH,
Radish21

Similar Messages

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation.  It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0.  How can I get this to work?

    I am using Numbers on my iPhone5 and cannot get the app to do a simple (SUM) calculation.  It shows the formula correctly in the cell, but all I get for my long list of numbers to add is 0.  How can I get this to work?

    Oaky, at least we got that far.  Next step is to determine if all those "numbers" are really numbers.  Changing the format to "number" doesn't necessarily change the string to a number. The string has to be in the form of a number.  Some may appear to you and me as numbers but will not turn into "numbers" when you change the formatting from Text to Number. Unless you've manually formatted the cells to be right justified, one way to tell if it is text or a number is the justification. Text will be justified to the left, numbers will be justified to the right.
    Here are some that will remain as strings:
    +123
    123 with a space after it.
    .123

  • On the fifa 14 iTunes app it won't let me turn on device music, how can I get this to work?

    On the fifa 14 iTunes app it won't let me turn on device music, how can I get this to work?
    I have bought full access to it.

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • Negative (to inline a letter or to thin it) offset path does not work in Illus-CC 2014 (when preview is on- nothing happens). How can I get this to work like in previous versions.

    Negative (to inline a letter or to thin it) offset path does not work in Illus-CC 2014 (when preview is on- nothing happens). How can I get this to work like in previous versions.

    Thanks for your quick reply. I tried a number of different values. Usually when I do a negative offset they're very small values, like -.25 or -.5.
    An Update- I took the art work into Ai CS 6 and It still did not work, which is really strange. And I've used it hundreds of times with success in the past. Also I tried it with live type and outlines, ungrouped, un-compounded still could not get it to negative offset.
    Thanks for the help.

  • My laptop has broken and i have been given a new one by apple - this has changed my serial number so my Adobe Ps,Ai etc are not working and say my licence has expired. How can i get this to work?

    My laptop has broken and i have been given a new one by apple - this has changed my serial number so my Adobe Ps,Ai etc are not working and say my licence has expired. How can i get this to work?

    uninstall anything adobe 'migrated' to your new mac, clean and then properly install, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    if you need an activation count reset, http://helpx.adobe.com/x-productkb/global/service1.html

  • Email messages from my icloud account update on all my devices showing if they have been read and if a reply has been sent.  This does not happen with my tinyworld (TalkTalk) email account.  Can I (how can I) get this to work with TinyWorld?

    Email messages from my icloud account update on all my devices showing if they have been read and if a reply has been sent.  This does not happen with my tinyworld (TalkTalk) email account.  Can I (how can I) get this to work with TinyWorld?

    You have to look at the email protocol being used.  the Apple email system uses IMAP, does Tinyworld use IMAP or POP?
    Does the email system permit delivery receipts to be requested?
    Just some of the things one needs to determine from the information provided by the email service provider.

  • How can i know how to redeem the code? how can i get this code?

    how can i know how to redeem the code? how can i get this code? please i need you help
    <Email Edited by Host>

    You are trying to create a new Apple ID? You don't have one yet? Is that correct?
    If so, then see this article on how to creat your Apple ID - and make up a password for it. Remember to write it down immediately.
    http://support.apple.com/en-us/HT203993

  • TS1702 My cars 2 app mate app is not working after upgrading from ipad to ipad 2...... synced.... uninstalled and re installed several times as well as wiped ne ipad out and re did the whole proccess several times. how can I get this app working?

    I have installed the cars 2 app mate on a ipad 2 from an ipad 1 synced with itunes account.. all is working except this app. After many times of un installing and re installing aswell as talking to apple tech suport this app is still not working.... its there it just has no function...... how can i get this installed and working, my grandson is autistic and uses this app many hours a day........ it is important for me to get this up and running again for him.......

    (1) So, I found a youtube video showing how to open up my iMac and replace a Disk drive. I opened it. I removed the disk drive. I opened the metal cover of the lid of the disk drive. It was clean and immaculate; so, it destroyed and debunked the dirty drive theory. But, just to make sure I sucked around the optical sensor with a vacuum and gently brushed it with a Q-tip.
    (2) I then watched a you tube video showing how the drive operated (it was a drive supplied with power outside an iMac with a transparent cover unlike the opaque metal cover that we have on our drives). My scientific curiosity started to wonder if somehow the mechanical part (of the electro-mechanical assembly) was locked or jammed. So, I started messing with the arms with the utmost care after watching the video to see if i could move them manually. Yes on some. The main arm that is linked with the drive motor was immovable. The rest I played with a little bit, took great notice in the start of the video to see how the arms looked before inserting a disk. I then put it all back together.
    It works now. My guess is that taking it out and then placing it back in along with the resetting options that others have done was the trick. I believe it is a possibility that the hard drive became locked mechanically in some strange manner after ejecting a DVD in conjunction with the uploading of the new OS. I believe the actual removal, reinstallation, and resetting of the drive put everything back into sync. My computer sits in a climate controlled dust free environment. I knew for a fact that this hard drive was OKAY.

  • How can I get this code to display 20 lines

    I need to get this code I have written to display 20 lines at a time, then the 20 using the Enter key.
    How would I approach this?
    I thought of making a RandomAcessFile object, but that seems like overthinking the problem, and I'm not sure that I could get that to work anyway.
    import java.io.*;
    public class ReadIt
    public static void main(String[] args)
         throws IOException
              System.out.println ("Enter The Desired .java Filename.");
              System.out.println ("Do not add the .java extention.");
              String fname;
              EasyIn type = new EasyIn();
              fname = type.readString();
              String fndotjava = new String(fname + ".java");
              //System.out.println (fndotjava);
              File inFile = new File(fndotjava);
              InputStream istream;
              OutputStream ostream;
              istream = new FileInputStream(inFile);
              ostream = System.out;
              int c;
              try
                     while((c = istream.read()) != -1)
                           ostream.write(c);
              catch(IOException e)
                     System.out.println("Error: " + e.getMessage());      
              finally
                    istream.close();
                    ostream.close();                 
    }Thanks
    Brad

    Well, a RandomAccessFile together with a counter should work. However, you can also achieve this by buffering the input rather than writing it directly out
    java.util.Vector vect = new java.util.Vector();
    try{
         while((c = istream.read()) != -1){
             vect.append(c);
    catch(IOException e){
         System.out.println("Error: " + e.getMessage());      
    finally{
         istream.close();                 
    }     with the help of
    java.util.Vector.size() and
    java.util.Vector.elementAt(int index)
    you are able to display only 20 lines at a time, you just need the additional code for reading System.in
    public static void prompt(String s){
        System.out.print(s + " ");
        System.out.flush();
      public static String readData ( BufferedReader in)  {
        boolean verfuegbar = true;
        while ( verfuegbar){
          try{
            S = in.readLine();
            if ( S != null)verfuegbar = false ;
          catch (IOException e){System.out.print (e);}
        return S;
      }now it should work with
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    prompt("return for continuing");
    int twentscount = 0;
    int count = 0;
    do{
       while( count < 20 && twentscount+count < vect.size() ){
           outstream.write(vect.elementAt(twentscount + count).toString() );
           count++;
    prompt("return");
    readData(in);
    twentscount += 20;
    count = 0;
    while(twentscount + count < vect.size());sure, this is code from head, and you can make many changes (e.g. instead of using twentscount use the modulo (%) operator saving one variable (while count % 20 != 0 ).
    I'm also not sure if it will definitly run , since i haven't tested it (especialy for index borders).
    I hope this will give you enough hints for this possible solution.
    Adrian

  • I wanted to watch tv on demands but says this is not HTML5 delivery so how can I get this to work on ipad so I can catch up my tv program any help?

    How can I get tv on demands working on my iPad  as wanted to watch my program but it says HTML5 not supported on this, so any ideas that can help?

    HTML5 is supported on the iPad but I assume that the site that you are going to doesn't yet support it. Does the site have it's own app - here in the UK the TV channels have their own apps, plus there are apps such as TVCatchup.

  • My iphone just was updated yesterday and now my calendars won't synch, how can I get this to work again?

    I just updated my iphone4g and now when synching my calendars will not update. How can I fix this?

    System restore can do that, I recommend to avoid using system restore, it can create problems as well as solve them.
    Try deleting the Firefox installation directory and then re-installing Firefox 3.6
    For 32 bit Windows the default location of the [http://kb.mozillazine.org/Installation_directory installation directory] is C:\Program Files\Mozilla Firefox\
    You can get Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html

  • I am running Firefox 4 - when I open a new tab, my recent history shows - how can I get this to work in Firefox 6?

    When opening a new tab, by clicking the + sign, in FF4, recent history and frequented web pages appear. I cannot get this to repeat in later versions of FF - 5 or 6. I like this feature - can I utilize it in FF6? I am running Vista Home Premium 6.06002 SP2 on a Gateway (emachines) T5246 Athlon 64 4200+ 2.2mHz dual core with 2 GB RAM.

    The Ask Toolbar is causing that in the Firefox 3.6.13+ versions. Uninstall that extension.
    There are a couple of places to check for the Ask toolbar:
    * Check the Windows Control panel for the Ask Toolbar - http://about.ask.com/apn/toolbar/docs/default/faq/en/ff/index.html#na4
    * Also check your list of extensions, you may be able to uninstall it from there - https://support.mozilla.com/kb/Uninstalling+add-ons

  • ODI and XML - how can I get this to work?

    Hi all.
    I'm working on a new dwh solution where the main source of data will come from XML-files. The problem is that we are having difficulties with the use of abstract types in the xsd-file.
    We currently use ODI to read the XML-files and to store the data in our database, but all fields from the XML-files are not visible in the target tables.
    The problem can be simplified like this example:
    We have a main element, testElement, which can contain one or more publications.
    Publication is of type PublicationType, and PublicationType is an abstract that contains title, author and date.
    We have four other types which extends PublicationType; BookType, MagazineType, NewspaperType and AdsType. They all contain additional fields.
    XSD-file
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="urn:testing:kontroll:example:oppgave:v1"
    xmlns:tns="urn:testing:kontroll:example:oppgave:v1"
    xmlns:xdb="http://xmlns.oracle.com/xdb"
    elementFormDefault="qualified">
         <element name="testElement" type="tns:TestElementType" xdb:defaultTable="TEST_TAB" />
         <complexType name="TestElementType">
              <sequence>
                   <element name="publication" type="tns:PublicationType" minOccurs="1"
                        maxOccurs="unbounded" />
              </sequence>
         </complexType>
         <complexType name="PublicationType" abstract="true">
              <sequence>
                   <element name="title" type="string"/>
                   <element name="author" type="string" minOccurs="0"
                        maxOccurs="unbounded" />
                   <element name="date" type="string"/>
              </sequence>
         </complexType>
         <complexType name="BookType">
              <complexContent>
                   <extension base="tns:PublicationType">
                        <sequence>
                             <element name="ISBN" type="string"/>
                             <element name="publisher" type="string"/>
                        </sequence>
                   </extension>
              </complexContent>
         </complexType>
         <complexType name="MagazineType">
              <complexContent>
                   <extension base="tns:PublicationType">
                        <sequence>
                             <element name="editor" type="string"/>
                             <element name="period" type="string" minOccurs="0"
                                  maxOccurs="1"/>
                        </sequence>
                   </extension>
              </complexContent>
         </complexType>
         <complexType name="NewspaperType">
              <complexContent>
                   <extension base="tns:PublicationType">
                        <sequence>
                             <element name="daily" type="boolean"/>
                             <element name="owner" type="string" minOccurs="0"
                                  maxOccurs="1"/>
                        </sequence>
                   </extension>
              </complexContent>
         </complexType>
         <complexType name="AdsType">
              <complexContent>
                   <extension base="tns:PublicationType">
                        <sequence>
                             <element name="company" type="string"/>
                             <element name="article" type="string" />
                        </sequence>
                   </extension>
              </complexContent>
         </complexType>
    </schema>
    XML-file
    <?xml version="1.0" encoding="UTF-8"?>
    <tns:testElement xmlns:tns="urn:testing:kontroll:example:oppgave:v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:testing:kontroll:example:oppgave:v1 ExampleXMLSchema.xsd ">
    <tns:publication xsi:type="tns:BookType">
    <tns:title>Boken</tns:title>
    <tns:author>Arne Svendsen</tns:author>
    <tns:date>2001</tns:date>
    <tns:ISBN>78979797</tns:ISBN>
    <tns:publisher>The Company Ltd</tns:publisher>
    </tns:publication>
    <tns:publication xsi:type="tns:MagazineType">
    <tns:title>Fancy Magazine</tns:title>
    <tns:author>Mads Madsen</tns:author>
    <tns:date>2011</tns:date>
    <tns:editor>Svante Svantesen</tns:editor>
    <tns:period>weekly</tns:period>
    </tns:publication>
    </tns:testElement>
    Can anybody tell me if this should work (and why it doesn`t)? Or if the XSD/XML looks wrong in some way?
    Is this a known limitation in Oracle or ODI etc.?
    Any pointers to documentation describing similar problems would also be helpful.
    Thanks,
    Bjørn
    Edited by: Bob1 on Dec 22, 2011 7:01 AM
    Edited by: Bob1 on Dec 22, 2011 7:03 AM

    From what I found in the document http://docs.oracle.com/cd/E25054_01/integrate.1111/e12644.pdf (section B.7.2.6), ODI does not support abstract=true for complextypes. The driver simply ignore them.
    We made a new xsd without these tags and were able to generate the required tables.
    I am a bit surprised that ODI don't support these abstract-tags.
    Regards Bjørn
    Edited by: Bob1 on Jan 2, 2012 1:45 PM

  • Installed "NEW" Flashplayer 11 SIX times...still does not work...HOW can I get this to work???

    First...I am NOT a developer...Just a "regular" user who is now fed up that once again, a new Adobe product has been released with bugs, so now I can no longer see whast I need to on my laptop. 
    Here's what I do know:
    IE 9
    Windows 7 - Home Version
    64 bit platform
    Tried to install your latest version of Flash Player six times...all of these times I received a confirmation that it was successfully completed.  NONE of those time did it work (tried YouTube, and your own site...nada).  I used the troubleshooting tips for Windows 7 and IE9...did not work.  And now I can't find a way to reinstall the old program that at least worked!  I need to be able to use this functionality to work today...what do I do?????

    Hello!
    I own a small company and we are having the same problems.
    IE9 is not working with the latest flash update infact the update has messed up flash complety for all sites once installed.  I went to YouTube eariler and it warned that I needed to install to the new Flash Player upon instaling and returning to YouTube it had the same message. This led us to download both the x86 and x64 versions and useing the uninstaller went through each one and tried the updates. None of the downloadable updates from Adobes site works. I have also loaded up Windows XP in a virtual machine and trying IE 8 with the latest updates and it as well does not work and does the same thing upon updateing it just keeps saying to install the latest update allthough it has allready been done!
    Now on the other hand I loaded FireFox and it had the same update and upon restarting the browser after applying the update and it works just fine!
    Im on a Windows 7 x64 Ultimate box and ran the WindowsXP in the VM. FireFox was loaded on the main OS and worked fine after said update.
    Of Course I have allready double checked the running addons in IE 9 and the files within the /system32/ and all the flash files go there (x86 and x64 were differnt named files)
    Im guessing there is something conflicting betwen IE (IE 8 and 9 tested)
    Now this is not just happining on this machine but all of our desktops and laptops no one has any trouble with FireFox working
    Also this will break all flash objects in IE even localy as now no flash works it acts like it is not installed.
    Guess will see how long this takes to get fixed or aknowledged...  lol

Maybe you are looking for

  • Combining 4:3 and 16:9 footage

    Hi! I have various footage that I want to put on a standard DVD. The aspect ratio of some of this footage is 4:3 and some of it is in 16:9. What would be the best way to get them all in 1 DVD without distorting any of it. Thanks. RV

  • JCO Connection

    Hi Experts, We use two types of JCo connections while connecting to back-end . 1 . Modeldata 2 . Metadata What is the use of each type of JCO connection ? Thanks a lot .

  • "  STEPS REQUIRED TO CONFIGURE SAP  UNIVERSE "

    What is the Procedure for establishing a universe report ?

  • GP process as iView

    Dear all, Is it possible to convert the GP work flow process as iView? Can any one help me in this regard? Thank you in advance with Regards, Balachander

  • CSA (Host IDS) and Source IP

    I am monitoring CSA Agents on the CiscoWorks Security Monitor. I notice that most alerts, specifically the alerts triggered by web server exploit attempts, don't record the Source IP address and Port of the attacker. I understand the difference betwe