Basic Java Concepts

I'm a Java novice, trying to learn it along with Jdeveloper side by side. My learning of the Java fundamental concepts led to the below understanding, please see if my understanding is not correct in any way.
The fundamental concept with Java is a CLASS, whose feature are its state and behaviour. The state of the class is stored in the definition of the class itself via ATTRIBUTES or in lay man's language VARIABLES. These attributes can be static, public, private or protectd.
The behaviour of a class is stored via METHODS within the definition of a class. METHOD is nothing but a block of code performaing a certain action.
A good example of a CLASS's state a behaviour can be a stock. A stocks state is available via its ticker symbol, price of the stock, and the date i.e. on a given date, a given stock has a particular price. So there are 3 attributes.
Now METHOD in the context of the above example is a means to capture the ever changing state of the above 3 attributes.
In short attributes or fields ( defined via declaration of variables inside the class) capture the state of an object, where as its interaction with the world external to the object captured by METHOD.
These 3 attributes are common to thousands of stock's in the outside market, so a common class called STOCK can be created to capture the state and behaviour of thousands of stocks. The same class can be called at the same time to capture the behaviour of N number of stocks. When a class is called as explained, each such call is called an INSTANCE of the CLASS. An OBJECT is an instance of SUCH a class.
Similar to CLASS is INTERFACE. A given class can only call the attributes and methods from one another class. If a class needs to inherit from more than one another class then it is accomplished via an INTERFACE. An Interface contains only the spec of the methods from other classes and not the entire piece of code for he method itself. The methods that are declared in the interface are implemented in the classes to which they belong to.
A PACKAGE in turn is a collected of CLASSES and INTERFACES. A PACKAGE helps in keeping the code oraganized and grouped by the functionaliy it delivers.
A Class can in turn be either a SUPERCLASS or a SUBCLASS. In our given example CLASS, there are some stocks which offer OPTIONS and some which do not. In order to cover that behaviours we will like to create sub class called STOCSKWITHOPTIONS, which will then refer to STOCK class to inherit the attributes and methods from that class. In this case STOCK is the SUPERCLASS, and STOCKOPTIONS is the SUBCLASS.
Thanks in advance

Nagarjuna,
there is an excellent tutorial series from Sun for basic and advanced Java features. It contains a lot of examples and explains every concept. You even download the tutorials.
See http://java.sun.com/javase/reference/tutorials.jsp
--olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • 4 basic java questions..

    ok so I already learned Java last year (in grade 11), but my teacher didn't really teach anything, we learnt everything by ourselves from the API... so theres a lot of things I actually don't understand, but for now I want to ask 4 basic questions:
    1. What does static mean?
    2. Why would u "final" a constant variable? ie. If you have a variable called SIZE which is set to 5, so if u want it to be a constant, just never change its value. But what does the keyword final do to it?
    3. What's super? I see it sometimes, and my teacher showed us in the applet exampls to use super.paint(g) or somethign like that for the paint method, but I never use that because I noticed it works fine without it..
    4. Whats a question mark? I saw a game that was made in java and it had a lot of places where it had a question mark , which was part of the syntax. For example,
    int j1 = i != 0 ? i - 1 : 199;
    OR
    JUMPVEL = (fSuperSlime) ? 65 : 31;
    I really don't understand these lines...
    feel free to answer any of these questions...

    wow cool...thanks.. that question mark thing is nice
    saves a few lines..
    now, about super, so u mean u can access the parent
    class's variables?Variables, methods, constructors, if the access level is such that it's allowed.
    This will be covered in any tutorial or text though.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • Basic java comparision

    Hi..
    I have a basic JAVA problem..can anyone help on this.
    I have a constant declared in a EMPConstanta.java
    public static String HISTORICAL = "historical";
    In another java class..i need to compare 2 strings..
    String statusType = req.getParameter("historical"); //this vale comes from JSP hidden parameter and the value of statusType is historical
    Now I want to compare with constant vale.. and I am doing like this..
    if(statusType.equals( ASMConstants.HISTORICAL)){
    statusType = ASMConstants.CURRENT;
    Problem is both the values are historical�but it is not entering to if condition..any suggestions

    http://forum.java.sun.com/thread.jspa?threadID=5203921&tstart=0
    avoid multi post

  • Berkeley DB master-slave replication basic java code example

    Hi,
    I am new user of berkeley db and I have limited knowledge of Java programming. Can someone help me with basic Java example code of how to do master-slave replication without elections.
    Thanx,
    Jani

    Hello,
    Please clarify a few points about your program:
    1. What platform and Berkeley DB version are you using?
    2. Are you planning on using the replication framework
    or base replication API for your application?
    3. When you say you want replication without elections,
    what exactly does that mean. For example, if you are using
    the replication framework elections are held transparently
    without any input from your application's code. In this case,
    DB will determine which environment is the master and which
    are replicas. Is that what you are thinking about or
    something else?
    Thanks,
    Sandra

  • Making some basic Java games

    Can anyone help on how to make some basic java games for my website if you could that would be helpful
    thanks,
    Louie

    Well, first of all you program the Framework, add Graphics / sounds / Data , then you put it in your HP - There you are!

  • Knight tour programming with only basic java

    i had this assignment from school which ask us to create a program to calculate how many posssibilities to complete knight's tour from a position using basic java and not using applet. So far i can only create an incomplete program which can only go a speccific way and is also incomplete. i am trying to understand the jaava applet type of knight tour program but got too confused as i have just started learning this. Please help me with this.
    here's my code:
    public class uk16638_a3{
         public static void main(String[] args){
         int horizontal[] = {2,1,-1,-2,-2,-1,1,2};
         int vertical[] = {-1,-2,-2,-1,1,2,2,1};
         int chessBoard[][]=new int[8][8];
         int move, currentRow = 0, currentCol= 0, move_count = 0, new_vert, new_horz;
    for(int i=0; i<8; i++)
         for(int j =0; j<8; j++)
              chessBoard[i][j] = 0;
    chessBoard[0][0] = 1;
    do{
    for(move=0;move<8;move++){
    new_vert = currentRow + vertical[move];
    new_horz = currentCol + horizontal[move];
    if ( (new_vert>=0) && (new_vert < 8) )
    if( (new_horz>=0) && (new_horz < 8) )
    if( chessBoard[new_horz][new_vert]==0 ) {
    chessBoard[new_horz][new_vert] = 1;
    move_count++;
    currentRow = new_vert;
    currentCol = new_horz;
    }}}while(move<8);}}

    Sorry with the inconvenience cause i am new with this forum so i am causing many problems to all of you. here's the full code i put but i would really like to ask someone to teach me on creating a backtrack and let the knight moves following a different sequence from the one i already set.
    public class uk16638_a3{
    public static void main(String[] args){
    //the movements of a knight horizontally and vertically
    int horizontal[] = {2,1,-1,-2,-2,-1,1,2};
    int vertical[] = {-1,-2,-2,-1,1,2,2,1};
    int chessBoard[][]=new int[8][8];
    int move, currentRow = 0, currentCol= 0, move_count = 0, new_vert, new_horz;
    //setting all elements in the array to 0
    for(int i=0; i<8; i++)
    for(int j =0; j<8; j++)
    chessBoard[i][j] = 0;
    //the knight starts here
    chessBoard[0][0] = 1;
    //using do while loop, i try to move the knight following the sequence i had already set in the array above. But because its moving at the same direction all the time, it gets stuck.
    do{
    for(move=0;move<8;move++){
    //setting the new coordinates for it to move to
    new_vert = currentRow + vertical[move];
    new_horz = currentCol + horizontal[move];
    if ( (new_vert>=0) && (new_vert < 8) )
    if( (new_horz>=0) && (new_horz < 8) )
    //new position check if its already occupied or not, if occupied it will move on to the next part of the move sequence i set
    if( chessBoard[new_horz][new_vert]==0 ) {
    chessBoard[new_horz][new_vert] = 1;
    move_count++;
    //current coordinate of the new knight position
    currentRow = new_vert;
    currentCol = new_horz;
    }}}while(move<8);}}
    Edited by: Mikki88 on Mar 2, 2009 1:53 AM

  • Basic Java Class with prints records out of the DEPT table

    Can some one show a basic java class which will query the DEPT table, and print them out?

    Nagarjuna,
    the Oracle DBMS JDBC Developer's Guide is full of code examples.
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm
    --olaf                                                                                                                                                                                                                                                                                                                       

  • Sap basic java libs, JMON, JCO

    Hi,
    Iam applying patch 27 for the portal ep6 sp2. the current patch is ep6 sp2 patch3 with j2ee pl 19.
    Now first iam doing patch 4 for ep6 sp2 and then upgrading to patch 27.
    My question now is for upgrading to patch 4 what version of java libs, jmon and jco i should maintain and later for patch 27 what version of basic java lib, jmon and jco i should maintain.
    The patch4 document says to update basic javalibs, jmon and jco to the latest available one.
    The latest available patches are
    basic java lib - patch 18
    jmon - patch 19
    do anyone know how to do this. any documents are notes available ???
    Thanks for your help in advance
    regards
    Moses

    Hi Moses,
    here is what to you have to do:
    1. Patch the Software Delivery Manager (SDM) to the newest Patch Level (PL 14) - as described in SAP Note 532892
    2. Patch the J2EE Engine to the newest available patch (PL 30) - as described in SAP Note 738921
    3. Patch SAP Basic Java Libs 6.20 to Support Package 18 - as described in SAP Note 544979
    Make sure IRJ service is stopped as mentioned in the thread Basic Java Libs 16
    4. Patch JMON to Patch Level 19. Installation (path were to copy the files) is described in SAP Note 657143. Unfortunately this note is not released. If you don't have a user to see the note, here is in short what you have to do:
    - unzip the archive: "sapcar -xfv JMON_19*.SAR"
    - copy file jmonapi.jar to the following directories:
         - ...j2ee_<Instance_Nr>adminlib
         - ...j2ee_<Instance_Nr>admin     ools
         - ...j2ee_<Instance_Nr>clusterdispatcheradditional-lib
         - ...j2ee_<Instance_Nr>clusterserveradditional-lib
         - ...j2ee_<Instance_Nr>clusterstateadditional-lib
         - ...j2ee_<Instance_Nr>clusterserverservicesfileworklibs
         - ...j2ee_<Instance_Nr>clusterserverstatefileworklibs
    - copy file jmon.dll and sapccmsr.exe to the directory:
         - ...j2ee_<Instance_Nr>os_libs
    5. If needed, patch SAP Java Connector to Service Release 2.0.10 - as described in SAP Note 682686 and the there mentioned installation guide.
    6. Now you can go on patching the Portal first to Patch 4 and than to Patch 27 as described in the installation guides.
    Hope this helps,
    Robert
    PS: Please consider rewarding points to people like Dominik (and me) , who are spending a lot of their time to give helpful replies like in this thread: cross domain SSO-EP6

  • Basic Java Sound Example.

    Hi,
    Can some one give me a basic java sound application( not applet ) to play a wav file.
    Thanks a lot.
    zia

    I did this search
    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Bplay+%2Bsound+%2Bwav+%2Bapplication&col=jdc&x=14&y=10
    looks like the answer should be there somewhere

  • Help with my basic java

    Hello i am in a high school programming class and i need help. I have to make an application that draws a basic face, and then i put in different scrollbars, drop menus and checkboxes to control how the face works. I have gotten most of what i need to do but i am stuck on, I need to have a so if i press it they will get closer together of farther apart, which is where im stuck. i can only make them move in the same direction. any ideas???
    heres the code.
    import java.awt.*;
    import java.awt.event.*;
    public class Unit9q extends java.applet.Applet implements AdjustmentListener,ItemListener {
         Graphics g;
         Checkbox mybox1,mybox2,mybox3,mybox4,mybox5;
         CheckboxGroup mygroup1,mygroup2;
         Choice mymenubar1,mymenubar2;
         String colorword,shapeword,menuitem1,menuitem2,eyefill,eyesstring;
         Color clr;
         int yaxis,inteyes,ineyes;
         Scrollbar yaxisscroll,eyes;     
         public void init() {
              yaxisscroll=new Scrollbar(0,50,1,120,140);
              yaxisscroll.addAdjustmentListener(this);
              yaxisscroll.setBounds(100,10,100,20);
              add(yaxisscroll);
              yaxis=120;
              eyes=new Scrollbar(0,50,1,120,140);
              eyes.addAdjustmentListener(this);
              eyes.setBounds(100,10,100,20);
              add(eyes);
              inteyes=110;
              mygroup1=new CheckboxGroup();
              mybox1=new Checkbox("Red",mygroup1,false);
              mybox2=new Checkbox("Blue",mygroup1,false);
              mybox3=new Checkbox("Green",mygroup1,false);          
              mybox4=new Checkbox("Filled",mygroup2,false);
              mybox5=new Checkbox("Outlined",mygroup2,false);
              add(mybox4);
              add(mybox5);
              mybox1.addItemListener(this);
              mybox2.addItemListener(this);
              mybox3.addItemListener(this);
              add(mybox1);
              add(mybox2);
              add(mybox3);
              clr=Color.white;
              mymenubar1=new Choice();
              mymenubar1.addItem("Square");
              mymenubar1.addItem("Circle");
              mymenubar1.addItem("Rectangle");
              mymenubar1.addItem("Oval");
              mymenubar1.addItemListener(this);
              mymenubar2=new Choice();
              mymenubar2.addItem("Square");
              mymenubar2.addItem("Oval");
              mymenubar2.addItemListener(this);
              add(mymenubar1);
         public void adjustmentValueChanged(AdjustmentEvent event){
              yaxis=yaxisscroll.getValue();
              inteyes=eyes.getValue();
              repaint();
         public void itemStateChanged(ItemEvent event) {
              menuitem1=mymenubar1.getSelectedItem();
              menuitem2=mymenubar2.getSelectedItem();
              if (mybox1.getState()==true) {clr=Color.red;}
              else if (mybox2.getState()==true) {clr=Color.blue;}
              else if (mybox3.getState()==true) {clr=Color.green;}
              repaint();
         public void paint(Graphics g) {
              g.setColor(Color.black);
              if (menuitem1.equals("Rectangle")){
                   g.drawRect(100,100,70,90);}
              else if (menuitem1.equals("Oval")){
                   g.drawOval(100,100,75,90);}
              else if (menuitem1.equals("Circle")){
                   g.drawOval(100,100,80,80);}
              else if (menuitem1.equals("Square")){
                   g.drawRect(100,100,80,80);}     
              if (menuitem2.equals("Circle")){
                   g.drawOval(80,100,10,10);}
              else if (menuitem2.equals("Square")){
                   g.drawRect(80,100,10,10);}     
                        g.setColor(clr);
              if (mybox4.getState()==true) {
                   g.fillRect(inteyes,120,10,10);
                   g.fillRect(ineyes,120,10,10);}
              else if (mybox5.getState()==true) {
                   g.drawOval(inteyes,120,10,10);
                   g.drawOval(ineyes,120,10,10);}     
              ineyes=inteyes+42;
              g.setColor(Color.black);     
              g.fillOval(128,yaxis,15,22);
              g.drawArc(111,160,50,20,0,180);     
         } //thank you if you can solve it

    Next time you post code, use the CODE button or [code] and [/code] tags so that it maintains the formatting from your editor.
    If two things are moving int the same direction, your adding N to both of their x-coordinates. If you want one to move in one direction and the other in the other direction, then you have to add N to one and -N to the other.

  • Basic HTML concepts and how they relate to eachother

    I am a grad student working on a project to visualize how the HTML markup is translated into a webpage in a browser. I am not a programmer, and thus am confused by how all the following concepts relate to one another. The goal lis to list them in a logical order and describe how one concept leads to the next in a sequential manner.
    I’d like to create a hierarchal list of all these terms and their definitions as a start. Here’s what I have so far.
    Tried to start with the most basic, and work my way up Any help would be appreciated. Any errors?
    SPECIFICATIONS
    WC3 / WHTWG Specification
    Defines the semantics, structure, syntax, and rendering of HTML code
    elements in HTML5 (tags)
    any element in the HTML namespace (as per the doctype declaration) - refers to all tags and their attributes - these tags are used to describe the meaning of the content they contain
        content model types     (tags can fit in one ore more of these categories of model types) 
            metadata - content that sets up the presentation or behavior of the rest of the content
            flow - elements that would be included in the normal flow of the document (fits in the HTML body tag)
            sectioning - defines the scope of heading and footers - create new sections in document
            heading - defines the header of a section, which can either be explicitly marked up with sectioning elements or implied by the heading content itself
            phrasing (similar to inline in HTML 4) - the text of the document, as well as elements used to mark up the text within paragraph level structures
            embedded - any content that imports other resources into the document
            interactive - any content that is specifically interacted for user interaction
    Outline Algorithm  (definition)
        Definition in the HTML5 spec of the rules that user agents should use when parsing code in order creating an outline of section content elements in an HTML     document
                    he outline (based on their ranking)
    AUTHOR
    HMTL5 Document - the document contenting HTML elements and authored content
    Document Semantics - the meaning associated with each HTML element Tag
        the collection of tags with meaning form the semantic structure of the HTML document
    Document Structure (combination of ordered semantic elements) - the order and nesting of tags, and the associations associated with the levels of nesting (ranking) create the document structure
        understanding the W3C outline Algorithm helps the author decide how and when to chose which elements to properly structure content
            understanding the process that HTML5 uses to outline documents will help in this decision
    USER AGENT (BROWSER)
    User Agent (browser)-
        the browser (application that user operates to interact with HTML documents
        parsing algorithm (executed) - the rules the browser uses to parses (walks through) the elements in order to establish its structure and add to the outline using     a parsing engine
            examples: webkit (safari) and gecko (firefox)
                body is established as the outline root (beginning)
        the result of the parsing is a Document object Model (DOM) and the Document Ouline
    Document outline - the nested,  hierarchical outline created by the browser parsing the html document’s structure and content
        each part of the outline is considered a node
            (relationships in the node are described with family tree terms like parent, child, and sibling.)
        sectioning and heading elements are used to define the outline
        sectioning elements are containers - so any elements contented within a a section is nested as a child in the parent’s section
    DOM -
        The DOM is the structure created by the DOM API in which  CSS and Javascript interact with and modify the HTML
        based on an object structure that closely resembles the structure of the documents it models.
        structure similar to that of a tree - in which every element is a node   
        similar to the document outline, but instead of a hierarchical list, the DOM is a tree diagram
    OUTPUT
    Final webpage

    As a rule of thumb, avoid all swing components (just use awt) because they are only available in 1.2. You can use all enhancements and bug fixes to awt components that are available in 1.4 (even 1.5).
    ;o)
    V.V.

  • Plese help! Stuck on some basic Java homework...

    I am taking this introduction to java class and we were given 3 homework assignments and I am really stuck on 2 of them.
    One of the assignments asks to make a index.html page that will connect to a mysql database for coffee/suppliers.
    The first part says:
    Create the index.html to create the following web page. After a user selects
    Espresso and 5 pounds, and clicks �Submit Order� button, he/she is going to see the
    following URL:
    http://localhost:8080/hmwk09/coffee_processing.jsp?name=Espresso&pounds=5&Submit=Submit+Order
    (which I sort of completed physically with dreamweaver. im not sure if i need to embed some java into that page.)
    The second part which I am really stuck on says:
    Create the coffee_processing.jsp that queries coffees and suppliers table (you created in homework 08) to display the following page:
    This part is where it queries the mysql database that I did. The page is basically supposed to look like this (in a webpage format):
    Here is the information about your order:
    | Name | Supplier | Price |
    | Espresso | The High Ground| 9.99 |
    Number of Pounds: 5
    Total Price: $49.95
    (I really confused on what I need to do to create a jsp to do this. Thanks so much in advance!)

    well, first create a jsp page that defines how the page will look. Then make use of a <jsp:useBean..> in combination with <jsp:getProperty....>
    and <jsp:setProperty....> to access a bean that does the database fetching.

  • ABAP & Java Concepts required for SAP-NW XI/PI

    Hi Experts,
        As a fresher, I want to start a career in SAP ans SAP Netweaver- XI/PI. After going through some blogs, forum, sap stuff etc, I came to know the prerequisites for XI is both ABAP and Java...
    But I am not sure which concepts in ABAP and Java are required for an SAP XI consultant, as I see SAP itself is an Ocean. So Apart from XI concepts , what are all the concepts needed in ABAP and Java.
    As for XI concepts are concerned there is a lot of stuff in SDN itself. Only thing is, one shd have patience to search and proper guidance while learning.
    Regards,
    Guru

    >
    Guru Bhai wrote:
    > Where and when do we need ABAP and Java in XI
    something quite common a question but here is a small desc.
    ABAP -
    for scenarios involving, IDoc, RFC, ABAP proxies and ABAP mappings
    Java -
    Core java - UDFs in graphical mapping
    advanced - java mapping, adapter modules, java proxies etc

  • Basic Java Program help needed urgently.

    I have posted the instructions to my project assignment on here that is due tomorrow. I have spent an extremely large amount of time trying to get the basics of programming and am having some difficulty off of the bat. Someone who has more experience with this and could walk me through the steps is what I am hoping for. Any Help however will be greatly appreciated. I am putting in a lot of effort, but I am not getting the results I need. Thank you for the consideration of assisting me with my issues. If you have any questions please feel free to ask. I would love to open up a dialogue.
    CIS 120
    Mathematical Operators
    Project-1
    Max possible pts 100
    Write a program “MathOperators” that reads two integers, displays user’s name, sum, product,
    difference, quotients and modulus of the two numbers.
    1. Create a header for your project as follows:
    * Prgrammer: Your Name (1 pt) *
    * Class: CIS 120 (1 pt) *
    * Section: (1 pt) *
    * Instructor: (1 pt) *
    * Program Name: Mathematical Operators (1 pt) *
    * Description: This java program will ask the user to enter two integers and *
    display sum, product, difference, quotients and modulus of the two numbers
    * (5 pts) *
    2. Display a friendly message e.g. Good Morning!! (2 pts)
    3. Explain your program to the user e.g. This java program can add, subtract, multiply,
    divide and calculate remainder of any two integer numbers entered by you. Let’s get
    started…. (5 pts)
    4. Prompt the user- Please enter your first name, store the value entered by user in a
    string variable name. Use input.next() instead of input.nextLine(). (8 pts)
    5. Prompt the user- name, enter first integer number , store the value entered by user in
    an integer variable num1.(5 pts)
    6. Prompt the user- name, enter second integer number , store the value entered by user in
    an integer variable num2.(5 pts)
    7. Display the numbers entered by the user as: name has entered the numbers num1and
    num2.(5 pts)
    8. Calculate sum, product, difference, quotients and modulus of the two numbers. ( 30 pts)
    9. Display sum, product, difference, quotients and modulus of the two numbers. ( 10 pts)
    10. Terminate your program with a friendly message like- Thanks for using my program,
    have a nice day!!(2 pts)

    Nice try. You have not demonstrated that you've at least TRIED to do something. No one is going to do your homework for you. Your "urgency" is yours alone.

  • O Dear! Basic Java Programming problem!

    import java.lang.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import java.util.Random;
    public class QuizApp extends Object
         public static void main(String[] argStrings) throws Exception
              Random random = new Random();
              int generateFirstFigure = random.nextInt(21);
              int generateSecondFigure = random.nextInt(31);
              int generateOperator = random.nextInt(3);
              String operator = "/";
              int correctAnswer = generateFirstFigure + generateSecondFigure;
              if (generateOperator == 0)
                   operator = "+";
                   int correctAnswer = generateFirstFigure + generateSecondFigure;
              if (generateOperator == 1)
                   operator = "-";
                   int correctAnswer = generateFirstFigure - generateSecondFigure;
              if (generateOperator == 2)
                   operator = "/";
                   int correctAnswer = generateFirstFigure / generateSecondFigure;
              //int correctAnswer = generateFirstFigure + operator + generateSecondFigure;
              int incorrectAnswerOne = correctAnswer -2;
              int incorrectAnswerTwo = correctAnswer + 1;
              int incorrectAnswerThree = correctAnswer + 3;
              String questionOne = "What is " + generateFirstFigure + operator + generateSecondFigure + "?"; 
              System.out.println(questionOne);
              System.out.println(incorrectAnswerThree);
              System.out.println(incorrectAnswerOne);
              System.out.println(correctAnswer);
              System.out.println(incorrectAnswerTwo);
    }Basically this code, creates 2 random characters and then allows you to either add, divide or subtract the two numbers... firstly this bit of the code doesnt work, secondly how can the user input a value (the answer) to the math's question?
    Thanks for help,
    Joel

    practissum wrote:
    dketcham, i printed out your hello world pumpkin. its a huge hit in the office!Sorry for propogating the off-topic remarks...but link to the hello world pumpkin?it was the friday coding challenge for last week:
    http://forum.java.sun.com/thread.jspa?threadID=5230548&messageID=9941964#9941964
    It's all about the pretty colors, and trying to squish a simple little program into a squarish-shape, so that another shape can be put within!
    As you can see, I have no real programming skills, but I like pretty colors, so it's all good.

Maybe you are looking for

  • My iTunes will not open...no error message and I don't have Norton 2005!

    I've upgraded my iTunes to 6.03 on my PowerMacG4, with MacOSX10.3.9. After a few times using iTunes 6.0.3, my iTunes stopped opening when I clicked on its icon in the dock. It doesn't show up in the top menu either. No error message shows up and I've

  • How to prevent a number field from getting summed?

    I want to display the # of clients per a certain ID number. (In order to show the duplicate records by setting a filter in the # of clients field). However, this works if the ID number is a text field... but it doesn't work if the ID number is a metr

  • Error in Invoice creation in MIRO

    Hello, Version 4.6 C During invoice creation in MIRO, the following error message occurs : " Item: 000001 PO Commitment Item 2CO0703800 Invoice Commitment Item. Message No FICUSTOM 068". For the message class FICUSTOM 068 in 4.6c the description is "

  • Adobe LiveCycle ES4 locators not starting

    Hi All, I am trying to start locators wasadmin@evvvv:TEST:caching> ./startlocator.sh : command not foundline 13: : command not foundline 16: : command not foundline 19: : command not foundline 22: : command not foundline 25: : command not foundline 2

  • Data replication offline/online

    e have a java application which has to work both in off-line and on-line mode.The application is in two tier architecture and the environment is : Forte(IDE),JVM 1.3.0 Hotspot,JDO,pointbase embedded for offline mode and oracle 8.1.7 for on line mode