Static Problem

I have class like this
import java.io.*;
public class TimeTest3 {
     private static BufferedReader stdin =
               new BufferedReader(new InputStreamReader(System.in));
     public  static void main(String[] args) throws IOException {
          Time3 t = new Time3();
          System.out.print("Enter Hour : ");     
          String input1 = stdin.readLine();
          t.setHour(Integer.parseInt(input1));
          updateDisplay();
          System.out.print("Enter Minute : ");
          String input2 = stdin.readLine();
          t.setMinute(Integer.parseInt(input2));
          updateDisplay();
          System.out.print("Enter second : ");
          String input3 =  stdin.readLine();
          t.setSecond(Integer.parseInt(input3));
          updateDisplay();
          System.out.println("Standart time is : " + t.toString() +
                       "; Universal time is : " + t.toUniversalString());
     public static void updateDisplay() {
          System.out.println("Hour : " + t.getHour() +
                       "; Minute : " + t.getMinute() +
                       "; Second : " + t.getSecond());
}when i run, i have message that
1. Cann't find symbol "t" in method updateDisplay , i know because t in inside method void main
2. I try to make Time3 t = new Time3(); under public class TimeTest3 {
but there is mesage that "t" is not static.
3. I try to delete static in method main and updateDisplay, but i get message
Exception in thread "main" java.lang.NoSuchMethodError: main
My Question is
1. What must i do to make my class can run ?
2. If i amn't wrong "t" in myclass is object, that's right ? How to make object become static ?
3. What's the mean Exception in thread "main" java.lang.NoSuchMethodError: main
Thx 4 your answer. Sorry if myenglish is bad, i hope u understand

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class TimeTest3{
     private static Time3 t;
     public static void main(String[] args) throws IOException {
          t = new Time3();
          BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
          System.out.print("Enter Hour : ");     
          String input = stdin.readLine();
          t.setHour(Integer.parseInt(input));
          updateDisplay();
          System.out.print("Enter Minute : ");
          input = stdin.readLine();
          t.setMinute(Integer.parseInt(input));
          updateDisplay();
          System.out.print("Enter second : ");
          input = stdin.readLine();
          t.setSecond(Integer.parseInt(input));
          updateDisplay();
          System.out.println("Standart time is : " + t.toString() + "; Universal time is : " + t.toUniversalString());
     private static void updateDisplay() {
          System.out.println("Hour : " + t.getHour() + "; Minute : " + t.getMinute() + "; Second : " + t.getSecond());
}

Similar Messages

  • Dell Audigy 2 and Windows SP3 driver and static problems

    SB0243
    Ok, Creative you and Dell have left us customer behind and giving us the shaft.
    I know you tell us to go to Dell to get drivers, and Dell still has the same driver posted they had when i bought my PC in 2003.
    Funny thing is that the only driver i find that work without the static problem is the one from the creative CD from 2003. The only catch is that none of the other sound Apps will install or work with windows SP3. So you end up with a card that has sound without static but only in two speaker mode, no mixer, EAX, CSMM, sound bank, etc... you know all the other stuff.
    I have installed Danial K driver at one time and they worked good for months then the static came back one day. Now after a fresh install of windows with SP3 i end up here with only the old driver working with just two speakers.
    This is very sad that a big company like creative can not create a driver that works with current software. You need to fire all your programmer and go hire two with all the money you paid everyone else and maybe then these two top programmer might be able to make something that works. This has become a joke in the sound industry.
    It was said that this ship is sinking, i think it has sunk at this point, us rats are jumping ship to some other card that works. Most likey it is not going to be from creative.
    Rainey

    ?Hey, I cant get CMSS to work here, im on windows 7 32bit, wich CMSS version are you using? I cannot open THX Console or EAX Console.

  • Using iMovie 7.1.4 on an iMac w/ Snow Leopard; HD video imported with a Firewire cable transfers fine, but audio arrives with major static; problem persists w/ different cameras

    Using iMovie 7.1.4 on an iMac w/ Snow Leopard; HD video imported with a Firewire cable transfers fine, but audio arrives with major static; problem persists w/ different cameras & Firewire cables; source DV tape has no audfio static.

    I forgot to write down my computer specs:
    iMac 27 Mid 2011
    2.7 GHz Intel Core i5
    4 GB 1333 MHz DDR3
    AMD Radeon HD 6770M 512 MB
    OS X 10.9.2

  • I-Trigue 3400 static problem..

    It's been only 4 months max since I've been using these speakers, and all of a sudden
    starting yesterday, static sounds appeared.
    I've tried plugging it out and waiting.. It was ok for a while.. but static returned.
    It is NOT my computer, since when I use my head phones or another speaker, no static can be heard.
    Also, if I turn the volume way- higher than my usual (almost to the max) the static disappears.
    What is wrong with my speakers? It is in warrenty so there is no problem getting an exchange, but
    I'd like to know if there's any way to fix it. If not, I'll get an exchange.

    I got the crappy same Problem!
    I plugged in my new Sennheiser HD590 (my 2nd Pair) into the Remote Control of the I-Trigue 3400. And i wondered of hearing these (static?) anoying tickling in the phones.
    I thought it could may be my Sennheiser Headphones, but i wondered cause I got the I-Trigue 3400 since January and until yet it worked fine.
    So I tried my old Sennheiser HD590 - same prob. I tried the Sennheiser MX500 (In-Ear-Phones) - same prob. I tried my Plantronics Audio .90 - same prob.
    Then I plugged in the Headphones directly into my Audigy 2 ZS - no (static?) tickling sounds anymore. I tried and experimented until yet 3 days now - un-/installing drivers - unplugging etc. - nothing worked.
    Please Support and tell me what is happening to my I-Trigue 3400 - I am using Creative Products for right over 8 Years now and i haven't got disappointed until yet. Go ahead!

  • External Speaker Static: Problem with audio jack?

    I don't believe that anyone on the forums had the same question. 
    I am having trouble with my macbook pro.  Whenever I plug in external speakers, I get bad static (very loud, about as loud as the speaker's audio itself).  I have tested this on multiple speakers and get the same results on all of them.  When used on another computer, the speakers work fine.  This suggests that it is something wrong with my audio jack for my mac. 
    I noticed that the 3.5 mm plug doesn't go all the way into the jack.  There is about a millimeter millimeter or two of space This isn't much, but may be resulting in the static.  I have tried forcing the plug all the way in, but it still does not go in.  Any ideas?
    I am trying to avoid having to get a bluetooth speaker or anything wireless. 

    Headphones don't induce grounding problems like external speakers. I am guessing the external speakers were all amplified speakers, with built-in amps and some sort of mains power supply. Perhaps you also have some peripherals such as a display connected to the Macbook Pro.
    Try this: disconnect all peripherals from the MBP (including the Magsafe power plug) except the external speakers and see if you get static. I will also guess that the static is more of a whine/buzz that changes whenever the computer does something different.
    If this works, then you have a common ground problem. The cheapest way to solve this is a Radio Shack ground loop isolator on the speaker cable,
    http://www.radioshack.com/product/index.jsp?productId=2062214
    High fidelity versions are also available, more like $300USD.

  • Audio static problems with video playback - Anyone Else?

    I went to archive.org and downloaded two movies for my iPod. Great. However, when played on the iPod there is this scratch/pop in the headphones every couple of seconds.
    It doesn't matter what headphones you use.
    It doesn't happen when you play the same video on the computer either in iTunes or Quicktime Player. And this is definitely more than the normal hiss and pop of old movies. Its piercing when you have in ear headphones on and quite distracting with apple buds.
    What I am wondering if this is a problem with all iPods or just mine?
    I don't have the problem with music videos or home made movies. Just the two movies I downloaded from archive.org. However, they do play fine on my computer. This is my last day to return the iPod and get a new one instead of service unit (which his actually probably new also because the Apple Service dept probably hasn't had refurbs yet, but I digress).

    I'm having the same problem with a file from archive.org. The file plays back fine using QT on my PC, but on the ipod the audio has periodic bursts of static.
    Here's a link to a file that exhibits the problem:
    http://www.archive.org/download/disorderin_the_court/disorder_in_the_court256kb.mp4
    Movie info is: MPEG-4, 320x240, Millions
    AAC, Stereo (L R), 48.000 kHz
    Movie FPS 29.97
    Data Rate 346.70 kbits/sec

  • Another static problem thread - Soundblaster Audigy 2

    I have read through many many topics about people have problems with the Audigy 2 ZS's I have tried many solutions people have had that fixed their problem or at least helped it nothing has worked yet.
    Here is my problem, I get static while I play games coming through my speakers or headphones whatever I am using. The static isnt as bad with some games but it usually starts 5 minutes into the game it varies by game shorter or longer, but after it starts it gets worse, louder and more persistant as time goes on. It gets to a point where its just unbereable all I can hear is just static. After I exit the game and listen to music or something the static will go away after about 5 minutes or so. The static is only present when there is sound being played. Also I never hear static just from playing music, always from playing games. I have tried using different PCI slots on my motherboard, uninstalling and reinstalling the drivers from the disc and from the website. Tried turning certain options off that some people found to help but nothing helps me. Now my card has not always had this problem, it started about 7 months after purchase just out of the blue.
    I had emailed the Creative support, but apparently they dont offer any support after 60 days of owning the card, the email said to try the forums or buy a tutor for 3 bucks for every 30 minutes. I figured I would try the forums first.
    My specs are:
    AMD Athlon 64 3000+
    K8N Neo4 Platinum MSI Motherboard
    XFX GeForce 6600 GT
    WD 80 gig hard dri've

    WOW what a horrible card. Absolute garbage.

  • Headphone static problems hp pavilion dv7

    I have a hp pavilion dv7 4290us and the internal speakers work great but when I plug-in headphones I get a lot of static. I can still here the music but it's very staticy.
    Any ideas? Thanks.

    Hi,
    Download the latest Audio Driver for your notebook and Operating system from the link below and save it to your Desktop.
    Windows 7
    When the download has completed, right click on the installer and select 'Run as Administrator' to start the installation.  When complete, restart the notebook and see if this has helped the issue.
    Best wishes,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Popping and static problem

    I am getting popping and static when any audio plays on my G4.
    Here are the things that I have tried:
    1) reset the NVRAM in Open Firmware
    2) zeroed the HD an installed fresh OS
    3) installed OS on second internal drive and booted from that drive
    4) ran TechTool Pro tests and everything passed
    The only other thing that I can think of (which I probably should have done earlier) is to disconnect and reconnect the cables on all of the drives. Any other suggestions will be appreciated.
    Thanks,
    Nathan

    Tom,
    Tried your suggestion with the speaker cable as well as the drive cables - no joy. I may have found the culprit. I unplugged the power chord for about 30 minutes or so before I opened up the unit. When I restarted, I got a message that the date was set to an earlier date or something to that effect. I read earlier today on Texas Mac Man's site that this indicates that the battery is bad.
    Could this be the problem? Can I start up the computer with the battery out to check if this is causing the static?
    Thanks,
    Nathan

  • T20 static problems

    I have read other problems about a whining sound but my problem sounds different. From the moment I removed my T20's their package and turned them on, even before they were connected to an audio signal, there was a loud hiss of static coming from the left speaker. Even after I connected them to an audio signal the static was still very much there. Increasing the treble causes the static to become louder, and while headphones are connected the static is gone. Sounds to me, from all the reports I've read, that Creative has produced a lemon on this one and could care less. I've already contacted them and was told to send them back for repair, AND I HAVE TO PAY FOR SHIPPING FOR THEIR FAULTY PRODUCT! Needless to say I am quite angry right now. The fact that there are pages and pages of reports full of problems with these speakers makes me question why Creative continues to sell these faulty products.
    Message Edited by Kristopher on 10-02-2007 09:07 AM

    I have exactly the same problem with these speakers. I'm going to do my best to put negative reviews on every site I can find. Wouldn't mind but Creative seem totyally unwilling to try to resolve the problems.

  • Help! iPhone 4 has terrible static problems, phone now unusable.

    I have a 32GB iPhone 4 from 2010. Over the last couple of weeks the phone part of the device has become unusable: every single phone call I make or receive is marred by so much static that it's impossible to conduct a phone conversation. It starts crackling as soon as I place a call. This happens regardless of where I am (often in my house, where I've had fine reception for years), on the Edge or 3G Networks, and regardless of whether I'm using Bluetooth. It happens whether or not the speakerphone is on. And there's no way it's caused by interference -- this happens at work, in my car, out and about, at home, etc. If it's an environmental problem, then all of San Francisco must be having the same issue. (The only place it didn't happen lately is -- you guessed it -- the Apple store!)
    Went to the Genius Bar today and was advised to:
    a) reset Network Settings -- no improvement
    b) Restore to original software -- no improvement
    The Apple Genius said he couldn't see any problems, but trust me, something is wrong. I cannot make any phone calls, period. There doesn't appear to be a problem with the regular audio component of the phone -- it records audio and video just fine. But the phone is completely busted.
    This is iOS 5.0.1, on a 32GB iPhone 4. Service provider is AT&T.
    Thank you! I'm going back to the Genius Bar tomorrow but really need my phone to function soon.

    I have exactly the same problem. I contacted my carrier, and was rudely informed there was nothing they could do as it was a problem with the phone. I swapped SIM cards however the phone still didn't work. I am disappointed with apple's customer service and products. The phone I am having trouble with was given to me as "a new phone" (I'm guessing its been refurbished) after I had problems with the wi fi.

  • Travelsound Notebook 500 extreme static problems

    Hello,
    I am hoping someone can help me with a problem I have been having with my travelsound 500 speakers. I installed the speakers and couldn't help but notice a very loud static noise coming from the speakers. I think I tried everything to remove it and found out where the source of the static was coming from. I have a skype CIT200 phone attatched and when I unplug the base set, the problem goes away. My question is therefore, is there anything I can do to have both the speakers and phone plugged in at the same time without having to unplug one then plug the other in? I really would appreciate any help or suggestions you can offer.
    Thank you
    m_ceberus

    Hello,
    I am hoping someone can help me with a problem I have been having with my travelsound 500 speakers. I installed the speakers and couldn't help but notice a very loud static noise coming from the speakers. I think I tried everything to remove it and found out where the source of the static was coming from. I have a skype CIT200 phone attatched and when I unplug the base set, the problem goes away. My question is therefore, is there anything I can do to have both the speakers and phone plugged in at the same time without having to unplug one then plug the other in? I really would appreciate any help or suggestions you can offer.
    Thank you
    m_ceberus

  • Random charger problems---an ESD (static) problem?

    Well, I got my macbook pro changed today because of the weird charger problem that has been addressed in some older posts (sometimes, when the charger is connected, the charger light won´t turn on, or just will come up in a very dimmed light). This appears to be a problem of the computer, but not of the charger (indeed, before having the computer changed, I bought a spare charger, and the new one didn´t solve the problem)
    I just wondered if those who have had the charger problem were using the iskin silicon keyboard protector, which builds up A LOT of static electricity. Can the static electricity built up by the keyboard cover be transmitted to the motherboard throughout the plug of the charger, or through any USB --or any-- port? It think it wouldn´t be so crazy to believe that when one tries to plug a device to the computer, it´s possible to touch --at the same time-- the MBP case and the connectors of the cumputer (attached to the motherboard), making a sort of bridge which leads the static eletricity into the MBP.
    Can that be possible; can the static built up by the keyboard cover be led into the computer?
    Best regards!

    Hi a.rothamel,
    While I may not be able to answer your question:
    +Can that be possible; can the static built up by the keyboard cover be led into the computer?+
    This I will tell you, I don't care how expensive it was, or how cool it looks, anything that built up static electricity on any of my laptops would have quickly found itself in the garbage.
    Since the days of the Wallstreet, I have been using the finest, softest, paper towel I can find to separate the keyboard from the screen.
    I have never had any build -up of static electricity. I have never had a screen marked up by the keyboard, and best of all, one $2.00 roll will serve for many years!
    (An afterthought, is it possible that you are leaving this cover on while the computer is running? This would not only possibly cause static electricity, it will also cause your MBP to heat up since some of the heat in laptops is dissipated through the keyboard.)
    PB

  • A stupid "static" problem.

    Sorry people. I am really new to this Java stuff.
    I understand what a static method means. But my problem is that whether all items (variables, method calls) inside a static method are assumed to be static as well.
    To rephrase: Can I safely say that items inside a static method are static by default?
    Sorry for the trouble. Thanks in advance.

    Thanks for responding.
    I've read one article, but I cant remember where that
    says all items inside a static method are assumed
    static. I really cant confirm this.
    Thanks.It doesn't really make sense to assume one way or the other. As TuringPest mentioned the variables inside a method (static or non-static) no longer exist once the method exits. So you cannot access those variables statically.

  • Lazy ManyToOne, setting weaving to static problem!

    Hello, I read in the manual that I need to change this property in the persistence.xml to static,
    so I could lazy ManyToOne and OneToOne, using "fetch = FetchType.LAZY". I did this:
    <property name="toplink.weaving" value = "static"/>But when I run the program I got stranges exceptions like this:
    Exception [TOPLINK-60] (Oracle TopLink Essentials - 2.0
    (Build b41-beta2 (03/30/2007))):
    oracle.toplink.essentials.exceptions.DescriptorException
    Exception Description: The method [_toplink_setcurso_vh]
    or [_toplink_getcurso_vh] is not defined in the object
    [entity.Aluno].
    Internal Exception: java.lang.NoSuchMethodException:
    entity.Aluno._toplink_getcurso_vh()
    Mapping:
    oracle.toplink.essentials.mappings.OneToOneMapping[curso]And this:
    java.lang.NullPointerException
         at oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.
    getMethodReturnType(PrivilegedAccessHelper.java:271)
         at oracle.toplink.essentials.internal.descriptors.MethodAttributeAccessor.
    getGetMethodReturnType(MethodAttributeAccessor.java:113)
         at oracle.toplink.essentials.mappings.ForeignReferenceMapping.
    validateBeforeInitialization(ForeignReferenceMapping.java:873)
         at oracle.toplink.essentials.descriptors.ClassDescriptor.
    validateBeforeInitialization(ClassDescriptor.java:3505)
         at oracle.toplink.essentials.descriptors.ClassDescriptor.
    preInitialize(ClassDescriptor.java:2198)
         at oracle.toplink.essentials.internal.sessions.
    DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:380)
         at oracle.toplink.essentials.internal.sessions.
    DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:360)
         at oracle.toplink.essentials.internal.sessions.
    DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:677)
         at oracle.toplink.essentials.internal.sessions.
    DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:559)
         at oracle.toplink.essentials.ejb.cmp3.
    EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
         at oracle.toplink.essentials.internal.ejb.cmp3.
    EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.
    EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.
    EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.
    EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
         at oracle.toplink.essentials.internal.ejb.cmp3.
    EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
         at test.Main.main(Main.java:23)When I remove the line:
    <property name="toplink.weaving" value = "static"/>Whitout this line in the persistence.xml, everything works fine, but the lazy ManyToOne does not work,
    it count as a FetchType.EAGER :/
    Here is the line where I use ManyToOne:
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="curso_id", referencedColumnName="curso_id",
    insertable = false, updatable = false)
    Curso curso;
    public Curso getCurso() { return curso; }Someone could help me? Thanks!

    I tryied to made the static weaving using maven, I followed this tutorial:
    http://spatula.net/blog/labels/maven.html
    But nothing happens! It runs the ant tasks, but the ManyToOne continues as a eager fetch!
    Help!

Maybe you are looking for