Very very simple question but..

public class zhen {
public static void main(String[] args)
String yourname;
yourname=Console.readLine("Please enter your name.");
System.out.println("Hello,"+yourname);
copy from the corejava book, but its not work, i feel strange. also, corejava book said that need to import corejava.*; but i copy and run it in jcreator, so i remove the import corejava.*.
Who can help me? it is too simple and embrass me.

I am not familiar with the corejava book, but here is an example that will work without any extra libraries, and will probably be more help to you in the long run.
import java.io.*;
public class Test
    public static void main(String[] args)
         try {
             BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
             System.out.print("Please enter your name:");
             String yourname = br.readLine();
             System.out.println("Hello," + yourname);
         } catch(Exception e) {
             e.printStackTrace();
}Here's a link to an I/O tutorial that should also help:
http://java.sun.com/docs/books/tutorial/essential/io/index.html

Similar Messages

  • How do I select a square brush for the brush tool in CS6?  Sorry if this is a simple question, but nothing has ever been simple for me in Photoshop.

    How do I select a square brush for the brush tool in CS6?  Sorry if this is a simple question, but nothing has ever been simple for me in Photoshop.

    I don't believe there is a square brush among the sets that ship with Photoshop, but there are plenty to download, and it is super easy to make one.
    Just drag with the rectangular Marquee tool, fill with black on a new layer, and go Edit > Define brush preset
    Browsing Photoshop Brushes on DeviantArt

  • This is a very simple question,but I don't know.Please me.Thank you!

    I am a Chinese student in a university.I have a very simple question to ask.
    I have writed a EJB module,and I have deployed to Weblogic8.1 successfully.
    1.Now I want to write a client program.Is it necessary that the client program is packaged in the EJB package.For example ,the EJB package is Beans,is "package Beans " or "import Beans.*" necessary in my client program.
    2.If I only know the EJB interfaces,that means the EJB module is writed by other programer.I want to know how I can write the client program.How can I call EJB module's method writed by other programer.Could you give me a simple example?
    Thank you very much.

    I have writed a EJB module,and I have deployed to
    Weblogic8.1 successfully.:-)
    1.Now I want to write a client program.Is it
    necessary that the client program is packaged in the
    EJB package.For example ,the EJB package is Beans,is
    "package Beans " or "import Beans.*" necessary in my
    client program.You need not package your client with the EJB. It can be a JSP/servlet or a stand-alone application.
    2.If I only know the EJB interfaces,that means the
    EJB module is writed by other programer.I want to
    know how I can write the client program.How can I
    call EJB module's method writed by other
    programer.Could you give me a simple example?
    import java.util.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import examples.*;
    class TestEJBHello {
        public static void main(String[] args) {
            Context context   = null;
            Object object     = null;
            // Hashtable for environment properties.
            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            env.put(Context.PROVIDER_URL, "t3://localhost:7001");
            HelloHome home            = null;
            HelloWorld hello          = null;
            try {
                context     = new InitialContext(env);
                object      = context.lookup("HelloWorldTest");
                System.out.println(" JNDI Looked up >>> " +object);
                home        = (HelloHome)PortableRemoteObject.narrow(object, HelloHome.class);
                hello       = home.create();
                System.out.println(hello.hello());
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                close(context);        // Closes the initial context.
        private static void close(Context context) {
            try {
                context.close();
                System.out.println("*** Context closed. ***");
            } catch (NamingException namingException) {
                namingException.printStackTrace();
            } catch(Exception exception) {
                exception.printStackTrace();
    }Here's a sample client app code I use for a HelloWorld EJB. You need to have a EJB client JAR containing the home and remote interfaces in the classpath during compile time and runtime.
    x

  • Very simple question - but cant find anything to do this! (other than a full proxy server)

    Simple one for everyone who has kids... I run a wrt54gs, v1.50.9 wireless network in my house. I have 2 teenage kids both with laptops...
    I'd like to be able to see what sites they're browsing (ie firewall logs) - but without installing something like 'netnanny ' on each laptop (there apears to be a log setup on the router but doesnt record anything let alone outgoing traffic)
    I know I can bar sites through the setup...but does anyone know of any app that will record from the router, who's looked at what site?,,,so I know (quietly!) what they're looking at?
    Cheers.

    Why not ask in the Flash or Actionscript forum; this is the Flash Player forum.

  • TS2972 apple tv can't sign in to iTunes Store until the network time has been set. this is an Apple generated message. what does it mean? how can i fix it? very very very simple questions but there is no reasonable answer from Apple anywhere on the intern

    this is an apple generated message. simple!
    what does it mean? so far no one at apple has a clue.
    how do i fix it? nothing even begins to address this issue so far. generalities about system setup show a lack of respect for customers. yes my system is plugged in and i have reset and rebooted and rechecked everything. i need help because this a real problem that needs a real solution, not more platitudes.
    help please, not more wasting of my time. i have spent an entire afternoon on this already.

    this is exactly the kind of response i expected, almost begged support to please not do this to me and yet there it is another meaningless, non helpful, standard template response to restart my apple tv.
    this does NOT work which is why i am contacting you. i have tried all suggestions about unplugging and restarting and nothing works.
    i live in an apartment and logon to the provided wifi wireless. so i do not have access to a router. however, management says they have talked with their provider and have been assured that the required ports are available.
    remember all the jokes about how bad windows was because the solution was always to re boot. funny huh? how is apple any different.
    i have been to the local apple care store and they are clueless, too.
    should we just end it here and you admit that i will not be getting any support from apple on this one? i got the ipad because my kids were such big fans. it is difficult for me to share their enthusiasm.
    at this point i am just curious about how you say you cannot support your own product so i can complete my file on this contact.
    thanks...sorry it was you who got this problem..

  • Simple question but can't find an answer anywhere

    This must surely be a very easy question for someone to
    answer (although I can't find an answer from any tutorial or
    forums, despite lots and lots of Google searching).
    I want to create a link from one SWF file to another (when
    these two files are 'stand alonE', not online). How do I it?
    I've managed to use Actionscript to create links to a website
    and another scene within the same SWF, so I'm surprised that this
    is proving so much more difficult.
    The script I have that's not working is:
    lesson1_btn.onRelease = function (){
    gotoAndStop("lessons.swf");
    (BY THE WAY Before you recommend I put everything online,
    this is for coursework and it specifies that the whole thing must
    be stand-alone.)
    Could the problem be with my Flash Player or the way I'm
    vieiwng the SWF? It doesn't work in test mode but neither does it
    work when I open the SWF directly from it's location.

    I'm not sure what you're doing with the
    gotoAndStop("lessons.swf"); command - whether lessons.swf is
    a scene or a frame label. If its a scene, then I think you need a
    frame number as well. (actually I don't know - I don't use this
    function)
    But you
    might want to take a look at the comments at the bottom of
    this page, I think - not sure if its relevant, but it seems like it
    could be :
    http://livedocs.adobe.com/flash/8/main/00001733.html#135769

  • Simple question, but can  you please help?

    i'm just getting into fooling around with Java on my PC, and i'm
    having some problems running this demo class that i created through one of the online tutorials. when i attempt to run it, i
    use:
    java -classpath c:\jhikel\divelog divelog.DiveLog
    but it give me an error:
    Exception in thread "main" java.lang.NoClassDefFoundError: divelog/DiveLog
    i am using the correct classpath for this class -- it is a simple class
    DiveLog in the divelog package that i created. can anyone help me out?
    thanks

    If the path structure is c:\jhikel\divelog\DiveLog.class and the package statement in DiveLog.java is
    "package divelog;"
    Then the classpath should be .;c:\jhikel
    because Java combines the classpath and the package to created a pointer to the DiveLog.class file.

  • A simple question but difficute for me

    I'm trying to write a simple java applet that is able to repond actions from "mouse" and "key board". But surprisingly, it can only repond actions from "mouse". I know that the functions "KeyDown" and "MouseDown" are depreicated methods, but they should still work though. If "MouseDown" can work, why "keyDown" is not working?
    import java.awt.*;
    import java.applet.Applet;
    public class Key extends Applet {
    public void paint(Graphics g){
    g.drawString("Hello", 50, 50);
    public boolean keyDown (Event e, int key){
    System.out.println("key down");
    return true;
    public boolean mouseDown (Event e, int x, int y){
    System.out.println("mouse pressed");
    return true;
    }

    then you need ActionListener
    for example
    addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jButton1_actionPerformed(e);
        });

  • This is prob a real simple question - but i am new to the ipod experience

    so please be gentle with me. i got a nano recently and love everything about it, and in relation to iunes it has taken over as my media player.
    however tonight when i hooked up the nano to change the laylists etc i get the recognition of the nano, the list of tracks on it but i am an unable to update it. now i have ched the settings and nothing has changed over the last week of use, except for a small locked padlock down on the bottom section of the itunes menu (next to the space gauge for the nano) and i cant work out how to remove it or change it. the nano is not in the HOLD position and i have no active parental controls.
    i am lost and what annoys me most is it is prob the simplest thing to fix (if you know how). so could any of you fine people tell the idiot what he has done wrong?
    thanks
    the itunes idiot

    The padlock icon indicates that iTunes is set for automatic synchronization to your iPod. Any changes you make in iTunes should automatically be reflected on your iPod. Are you attempting to make changes directly on your iPod as mounted in iTunes (which you cannot do unless you set iTunes for manual synchronization); i.e. you're trying to alter the playlists and tracks as shown under the disclosure list for your iPod in the iTunes Source list? Or are you changing the playlists, etc. created in iTunes?
    If you're not clear on all of this, you might find the iPod/iTunes tutorials helpful.
    Regards.
    Message was edited by: Dave Sawyer

  • Some simple question , but i dont know...try & catch ..

    Hi i was working on a media player and i've faced some problems...like what exactly does the try&catch do ??
    and in the Player class what the realize() and prefetch do ??
    Thank you in advance..
    Mulham Haffar

    If you are in doubt when or what exceptions to catch, use the java compiler as your guide. You will get compile time errors that clearly name the exception you have to catch with the line of code that could cause the exception/error. Then do the following:
    try {
      // the code that could throw the exception
    } catch ([the-name-exception] e) {
      e.printStackTrace();
      // or do something else relevant here - this code gets executed when the exception is thrown
    } finally {
      // this is an optional block that is always executed before returning from the method (even if there was an exception thrown - do stuff like closing resources here
    }where [the-name-exception] is the exception class I mentioned earlier.
    You can also declare a method to throw the exception if you don't want to catch it. Just use the keyword "throws" followed by the class name of the exception. Then any place where you call the method will have to catch the exception.
    You can also find out what exceptions are being thrown by looking in the JavaDocs. There is plenty more, but that is what you will need to get your program compiling.

  • Repost: Simple question but no one answers

    I have to repost this, there is no way I can find the solution on the forums. Tried everything...
    Scenario:
    UIX page with READ-ONLY table. User selects some row and clicks button. Event fires.
    How to retreive selected READ-ONLY row????
    Please help, this is urgent. I would need some code or pseudo code.

    Finally I did it. Here is how.
    In UIX page with a table drop submit button and add event to it:
    <event name="cur">
    <method method="myCurrentRow" class="model.TestUtils"/>
    </event>then create custom java class:
    package model;
    import javax.servlet.http.HttpServletRequest;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.model.binding.DCUtil;
    import oracle.adf.model.servlet.HttpBindingContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.jbo.Row;
    public class TestUtils
    public static EventResult myCurrentRow(BajaContext bc, Page page, PageEvent event)
        HttpServletRequest request = bc.getServletRequest() ;
        BindingContext bcc = HttpBindingContext.getContext(request);
        DCBindingContainer dbc = DCUtil.findBindingContainer(bcc,"dataPage1UIModel");
        DCIteratorBinding study = dbc.getIteratorBinding("StudyView1",null , "StudyView1Iterator");
        Row currentRow = study.getNavigatableRowIterator().getCurrentRow();
        Object[] o = currentRow.getAttributeValues();   
        for (int i=0, l=o.length; i<l; i++)
          System.out.println("i = " + i + "o= " + o[i]);
    return null;
    //return new EventResult(new Page (page, "ForwardName"));

  • Simple Question but have yet to find any info

    Let say I am setting up a database on one machine and I want it to live migrate to another - I have 4 luns - lets say /OVS for shared reporsitory - /pr01 - oracle binaries - /prdb for database files and /prlg for logs -
    I know I need to make the OVS ocfs2 - now do I create 2 Vm's and how do I present the other luns to the server - Do I have to ocfs2 these also ? - or do I just edit vm.cfg and add them in as say ext3 filesystems ?
    Thanks for help - This is not RAC

    Greetings,
    Q: Let say I am setting up a database on one machine and I want it to live migrate to another - I have 4 luns - lets say /OVS for shared repository - /pr01 - oracle binaries - /prdb for database files and /prlg for logs -
    I know I need to make the OVS ocfs2 - now do I create 2 Vm's and how do I present the other luns to the server - Do I have to ocfs2 these also ? - or do I just edit vm.cfg and add them in as say ext3 filesystems?
    A: Please note that you have two option, a) 4 LUNs or b) use 1 LUN for /OVS and 3 shared virtual disks, i.e. pr01.img, prdb.img and prlg.img located in the /OVS/SharedDisk directory. Let's break down each option.
    Q: How do I present the other luns to the server.
    A: You present all the LUNs to each "Oracle VM server" using the identical configuration, i.e. please see http://itnewscast.com/chapter-6-oracle-vm-22-san-iscsi-and-nfs-backend-storage-configurations#SAN_Storage_Repository_Configuration for configuration details.
    Q: Do I have to ocfs2 these also?
    A: If you mean using OCFS2 for the /pr01,/prdb and /prlg LUNs, the answer is not really. You could provision the LUNs and format each LUN with ext3, then present the LUNs to each host and then in each guest in it's vm.cfg file. Please see http://itnewscast.com/chapter-6-oracle-vm-22-san-iscsi-and-nfs-backend-storage-configurations#SAN_Storage_Repository_Configuration for the hosts and http://itnewscast.com/chapter-6-oracle-vm-22-san-iscsi-and-nfs-backend-storage-configurations#Oracle_VM_Guest_Front-end_Storage for the guest configuration details.
    Please note that the option to use shared virtual disks for the /pr01,/prdb and /prlg directories would create a separate file backed block device, i.e. pr01.img, prdb.img and prlg.img file for each directory in the /OVS storage repository located in the /OVS/SharedDisk/ directory. Shared virtual disks are available and manageable in Oracle VM Manager. This option would only require one LUN, i.e. for the /OVS root storage repository. Live Migration with this configuration is an integrated feature, i.e. nothing to configure other than a root storage repository, i.e. http://itnewscast.com/chapter-6-oracle-vm-22-san-iscsi-and-nfs-backend-storage-configurations#SAN_Storage_Repository_Configuration
    Q: do I just edit vm.cfg and add them in as say ext3 filesystems?
    A: Yes, each option (luns or shared v disks) will require entries for each of the LUNs or shared virtual disks in each guest's vm.cfg file. Ext3 can be used for each lun.
    I hope this helps!
    Respectfully,
    Roddy
    Edited by: Roddy Rodstein on May 4, 2010 3:44 PM

  • Simple question but urgent help needed....

    I am using Sqlplus i need help on one query. I have got table with 34,000 rows and i would like to findout the frequency frm that table...can anyone help me plz how shud i do it?
    I have all this field in my table ( PROD_ID CUST_ID TIME_ID PROMO_ID QUANTITY_SOLD AMOUNT_SOLD)
    I need to find out the frequency for quantity sold column can some1 help me plz.
    Message was edited by:
    user562879

    SQL> create view v as select column_value as item from table(integer_tt(17, 17, 14, 16, 15, 24, 12, 20, 17, 17, 13, 21, 15, 14, 14, 20, 21, 9, 15, 22, 19, 27, 19));
    View created.
    SQL> select * from v;
          ITEM
            17
            17
            14
            16
            15
            24
            12
            20
            17
            17
            13
            21
            15
            14
            14
            20
            21
             9
            15
            22
            19
            27
            19
    23 rows selected.
    SQL> @count item v
          ITEM      TOTAL    %
             9          1    4
            12          1    4
            13          1    4
            14          3   13
            15          3   13
            16          1    4
            17          4   17
            19          2    9
            20          2    9
            21          2    9
            22          1    4
            24          1    4
            27          1    4
    13 rows selected.
    SQL> @cardinality item v
    Occurrences Groups with this cardinality   Total rows Proportion
               1                            7            7         30
               2                            3            6         26
               3                            2            6         26
               4                            1            4         17
                                                        23        100
    4 rows selected.

  • Flash cs3 simple question

    I know this is a very simple question, but i just dont know
    what im doing wrong
    Im trying to add a script on a movie clip, but everytime i
    click on the movie clip then click on the actions i get a message
    "Current selection cannot have actions applied to it"
    I have done everything i can think of to add script to the
    movie clip.

    "old way of programming buttons will work!"
    However, this is not the preferred way to add actions to
    symbols.. You should get into the habit of doing it correctly. You
    code will be more organized, and can make performance increase. If
    you want to use AS2, I strongly suggest attaching your actions to
    the frame. It is very simple, and a much better practice.. give
    your symbol an instance name and attach this to a frame.
    instancename.onRelease = function(){
    trace("I've been clicked");
    using on(release) and such, is outdated and not good practice
    for you for the future. Why revert to the old bad habits, when you
    can learn the new, and future of programming in AS

  • A simple question please help.

    Hi
    I have 2 textfields and a button. I want to input a number( diameter) in the first textfield  ( inputField) and by clicking on the button (myButton), I want to get the result (circonference) in the second textfield ( inputField1). diameter*3.14. I know it is a simple question, but it comes from a very simple mind. So have mercy on me.
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
    import flash.events.MouseEvent;
    var inputField:TextField = new TextField();
    var myFormat:TextFormat = new TextFormat();
    myFormat.size = 44;
    inputField.defaultTextFormat = myFormat;
    inputField.restrict = "0-9";
    inputField.maxChars = 6;
    inputField.multiline = false;
    inputField.textColor = 0x000000;
    inputField.border = true;
    inputField.width = 150;
    inputField.height = 50;
    inputField.x = 75;
    inputField.y = 50;
    inputField.borderColor = 0xFF0000;
    inputField.type = "input";
    addChild(inputField);
    var inputField1:TextField = new TextField();
    var myFormat1:TextFormat = new TextFormat();
    myFormat1.size = 44;
    inputField1.defaultTextFormat = myFormat;
    inputField1.maxChars = 1;
    inputField1.multiline = false;
    inputField1.textColor = 0x000000;
    inputField1.border = true;
    inputField1.width = 150;
    inputField1.height = 50;
    inputField1.x = 275;
    inputField1.y = 50;
    inputField1.borderColor = 0xFF0000;
    addChild(inputField1);
    myButton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
       trace("Mouse clicked");

    use:
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
    import flash.events.MouseEvent;
    var inputField:TextField = new TextField();
    var myFormat:TextFormat = new TextFormat();
    myFormat.size = 44;
    inputField.defaultTextFormat = myFormat;
    inputField.restrict = "0-9";
    inputField.maxChars = 6;
    inputField.multiline = false;
    inputField.textColor = 0x000000;
    inputField.border = true;
    inputField.width = 150;
    inputField.height = 50;
    inputField.x = 75;
    inputField.y = 50;
    inputField.borderColor = 0xFF0000;
    inputField.type = "input";
    addChild(inputField);
    var inputField1:TextField = new TextField();
    var myFormat1:TextFormat = new TextFormat();
    myFormat1.size = 44;
    inputField1.defaultTextFormat = myFormat;
    inputField1.maxChars = 1;
    inputField1.multiline = false;
    inputField1.textColor = 0x000000;
    inputField1.border = true;
    inputField1.width = 150;
    inputField1.height = 50;
    inputField1.x = 275;
    inputField1.y = 50;
    inputField1.borderColor = 0xFF0000;
    addChild(inputField1);
    myButton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
    function fl_MouseClickHandler_2(event:MouseEvent):void
    inputField1.text=String(Math.PI*Number(inputField.text));

Maybe you are looking for