Free Essay

Java Classes and Methods

In:

Submitted By drewgolf
Words 566
Pages 3
IT110-1301A-02 Introduction to Programming
Phase III DB
Andrew Ramona
1/22/2013
This discussion board I will discuss what predefined methods that I might consider using and why. Also, where to find other sources for finding predefined Java classes and methods. Last we can look at some other programmer defined methods I might consider using based on the class and case diagrams from week 1.

Well the first method I will definitely use is the JOptionPane method. This is the perfect tool for allowing the customer to enter the required data for ordering golf balls from SkyGolf. This will allow them to be able to select the different options for the balls, color, number, and type in the required information for a custom imprint or adding a logo. JOptionPane can then also display in a window after all of the selections have been made and the customer can verify the information is correct. Then you can prompt the customer if everything is correct to enter a 1 or if it is incorrect then maybe select a 2 to route them back to the selection process. The scanner method can also be used to accomplish the same results except all of the information is shown line by line in a command window. I would use this method for the customer input but the JOptionPane has a better visual appearance for the user with graphical user interface (GUI).

I have found that the Oracle website is a good source for finding predefined Java classes and methods. These can be found at the address http://docs.oracle.com/javase/6/docs/api/allclasses-noframe.html. It’s really unbelievable how of these are available. Also, just by using the program will give the experience using the predefined classes and methods to be able to build your own programmer defined methods.

Well it seems there is going to be many choices for creating programmer defined methods for my class and case diagrams for SkygGolf. I would definitely use value returning methods so the customer can not only see their selections and they can be assigned to a variable. Of course we will need the getFirstName() and the getLastName() methods to gather customer information. The getPrice() would be a method I would create to be able to show the customer the price of the golf plus being able to show the total price for the order to include calculating the sales tax. A double variable defined will hold the result of the method. The getEmail() would be another method I would create so the customer could have ordering information sent to them electronically and future emails for new product information.

In conclusion, I look forward to working more with the GUIs like JOptionPane and other applications when building programs in Java. I found a lot of helpful information on the Oracle website which I would expect to use in the future for reference. I’m sure with more practice creating methods will come a lot easier then what I understand now. It seems that the initial planning using case and class diagrams will be very helpful when building programmer defined methods.

Resources:

Richard A. Johnson. (2007). An Introduction to Java
Programming and Object-Oriented Application Development. Boston, MA
Other sources for predefined classes and methods. Retrieved January 22, 2013, from

http://docs.oracle.com/javase/6/docs/api/allclasses-noframe.html

Similar Documents

Premium Essay

Asdsada

...UNIVERSITY College of Computer Studies Introduction to Programming Activity Book Compiled by: Mark Godfrey D. Torres 2012 Introduction to Programming ii Table of Contents Weeks 1 to 3 – Creating Your First Java Classes ....................................................................................... 1 Objectives ........................................................................................................................................... 1 Summary ............................................................................................................................................ 1 The Don’ts........................................................................................................................................... 2 Key Terms ........................................................................................................................................... 3 Seatwork............................................................................................................................................. 6 Where to Save Your Files ................................................................................................................. 6 Configuring Windows to Work with the Java SE Development Kit................................................... 6 Your First Application ...................................................................................................................... 8 Adding...

Words: 4647 - Pages: 19

Premium Essay

Java

...Mohammad Doush Mr. Matthew Robert English 103 13 April 2013 Java the Programming Language Computer is very important in our live, we use computer in everywhere on our live. The doctor uses the computer to see file or pictures of his patients. Also, each engineer uses it in many ways of his work. The teacher in the classroom, employees in the offices and student in their study all of them use computer in them daily live. They are not using the mouse, the keyboard or the scream. They are using the applications by them these applications in the computer are like the soul in the body. The only way to build these applications is programming. To program we need to know one of the programming languages which are very similar each other. If you are professional in one of these languages you can be professional in the other language in a short period of time. It is acceptable if you have the same application written with Java once and with C++ or C sharp at the same time. So for this reason you cannot say that a programming language is better than others. There are three types of programming languages procedural, functional and object-oriented languages. The most uses of these languages are object-oriented and one of these languages is Java you can write any application you need using it. Also you can translate any application to its word. The message of the High-Level programming languages such as Algol and Pascal in first programming revolution was...

Words: 2352 - Pages: 10

Premium Essay

Importanat Terms of Java

...A Abstract: A Java keyword used in a class definition to specify that a class is not to be instantiated, but rather inherited by other classes. An abstract class can have abstract methods that are not implemented in the abstract class, but in subclasses. Abstract class: A class that contains one or more abstract methods, and therefore can never be instantiated. Abstract classes are defined so that other classes can extend them and make them concrete by implementing the abstract methods. Abstract method: A method that has no implementation. Abstract Window Toolkit (AWT): A collection of graphical user interface (GUI) components that were implemented using native-platform versions of the components. These components provide that subset of functionality which is common to all native platforms. Largely supplanted by the Project Swing component set. See also Swing. Access control: The methods by which interactions with resources are limited to collections of users or programs for the purpose of enforcing integrity, confidentiality, or availability constraints. ACID: The acronym for the four properties guaranteed by transactions: atomicity, consistency, isolation, and durability. Actual parameter list: The arguments specified in a particular method call. See also formal parameter list. API: Application Programming Interface. The specification of how a programmer writing an application accesses the behavior and state of classes and objects. Applet: A component that typically...

Words: 6835 - Pages: 28

Premium Essay

Java

...JMaster list of Java interview questions - 115 questions By admin | July 18, 2005 115 questions total, not for the weak. Covers everything from basics to JDBC connectivity, AWT and JSP. 1. What is the difference between procedural and object-oriented programs?- a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination of data and code. b) In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in turn assures the security of the code. 2. What are Encapsulation, Inheritance and Polymorphism?- Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions. 3. What is the difference between Assignment and Initialization?- Assignment can be done as many times as desired whereas initialization can be done only once. 4. What is OOPs?- Object oriented programming organizes a program around its data, i. e. , objects and a set of well defined interfaces to that data. An object-oriented program can be characterized as data controlling 5. access to code. What are Class, Constructor...

Words: 6762 - Pages: 28

Premium Essay

Java

...Software Design Introduction to the Java Programming Language Material drawn from [JDK99,Sun96,Mitchell99,Mancoridis00] Software Design (Java Tutorial) © SERG Java Features • “Write Once, Run Anywhere.” • Portability is possible because of Java virtual machine technology: – Interpreted – JIT Compilers • Similar to C++, but “cleaner”: – No pointers, typedef, preprocessor, structs, unions, multiple inheritance, goto, operator overloading, automatic coercions, free. Software Design (Java Tutorial) © SERG Java Subset for this Course • We will focus on a subset of the language that will allow us to develop a distributed application using CORBA. • Input and output will be character (terminal) based. • For detailed treatment of Java visit: – http://java.sun.com/docs/books/tutorial/index.html Software Design (Java Tutorial) © SERG Java Virtual Machine • Java programs run on a Java Virtual Machine. • Features: – – – – – Security Portability Superior dynamic resource management Resource location transparency Automatic garbage collection Software Design (Java Tutorial) © SERG The Java Environment Java Source File (*.java) Java Compiler (javac) Java Bytecode File (*.class) Java Virtual Machine (java) Software Design (Java Tutorial) © SERG Program Organization Source Files (.java) Running Application Running Applet JAVA BYTECODE COMPILER Class Files (.class) JAVA VIRTUAL MACHINE WEB BROWSER Software Design (Java Tutorial) © SERG Program Organization Standards •...

Words: 5230 - Pages: 21

Premium Essay

Java R. P.

...siebert@ira.uka.de anwalt@ira.uka.de This work was partially funded by the DFG program GRK 209-------- ABSTRACT For the application of Java in realtime and safety critical domains, an analysis of the worst-case execution times of primitive Java operations is necessary. All primitive operations must either execute in constant time or have a reasonable upper bound for their execution time. The difficulties that arise for a Java virtual machine and a Java compiler in this context will be presented here. This includes the implementation of Java’s class and interface model, class initialization, monitors and automatic memory management. A new Java virtual machine and compiler that solves these difficulties has been implemented and its performance has been analysed. Although incremental garbage collection techniques can help to reduce the likelihood for a blocking garbage collection pause, they can not guarantee it. It can still occur that the collector does not make sufficient progress and does not catch up with the application. Consequently, the system can fail or require long blocking pauses to recycle memory or defragment the heap. A deterministic implementation of Java must provide means to determine worst-case execution times for Java’s primitive operations. The dynamic structure of Java, with inheritance, virtual method calls and multiple-inheritance for interfaces, poses several difficulties for the implementation. The time required for calls or type checks must...

Words: 6709 - Pages: 27

Premium Essay

Bout This

...Pasig campus pangilinan DSITI-AI Oct 27 15 Java Programming java programming Introduction in java programming Objectives * Object-Oriented Programming Language * Object-Oriented Programming Principle * Benefits Of Object-Oriented Programming * Introduction To Java Programming * Resources Used To Create a Java Programming *Structures Of a Java Programming * Result Of Executing The Java Programing Object Oriented Programming Language (OOPL) OOPL Is An Extension Of Procedural Language. Involves Creating Program Components as Object Related To The Real Word. Writing Object-Oriented Programs Involves Creating Object And Application That Uses Those Objects. An Object Contains Both Data Procedures Can be packaged Into a Single Unit. Based On Three Concepts Encapsulation Ability To Bind Data And Procedures Into an Object. Inheritance Ability Of Objects To Acquire The Attributes Or Behavior Of Other Objects Or Classes. Polymorphism Ability of An Object To Take Many Forms Or Identities. Benefits Of Object-Oriented Programming *Reusability -Able To Reuse The Defined Objects. *Adaptability –Able to fit in different environment. *maintainability –Able to change easily. *reliability –Able to operate...

Words: 1445 - Pages: 6

Free Essay

Dnfkdsfnklff

...CertPrs8/OCA/OCP Java SE 7 Programmer I & II Study Guide (Exams 1Z0-803 & 1Z0-804)/Sierra/177200-6/FM CONTENTS AT A GLANCE Part I OCA and OCP 1 Declarations and Access Control .............................. 3 2 Object Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3 Assignments 4 Operators 5 Working with Strings, Arrays, and ArrayLists .................... 257 6 Flow Control and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 .............................................. 165 ................................................ 223 Part II OCP 7 Assertions and Java 7 Exceptions ............................. 377 8 String Processing, Data Formatting, Resource Bundles . . . . . . . . . . . . . . 417 9 I/O and NIO 477 10 Advanced OO and Design Patterns 11 Generics and Collections .............................................. ............................ 541 .................................... 573 12 Inner Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681 13 Threads 713 14 Concurrency 15 JDBC A About the CD Index .................................................. .............................................. 785 ................................................... 841 .....

Words: 2596 - Pages: 11

Free Essay

Test Bank Data Structure and Java

...Data Structures with Java John R. Hubbard Anita Huray University of Richmond Chapter 1 Object-Oriented Programming Answer “True” or “False”: 1. An analysis of the profitability of a software solution would be done as part of the feasibility study for the project. 2. The best time to write a user manual for a software solution is during its maintenance stage. 3. The requirements analysis of a software project determines what individual components (classes) will be written. 4. In a large software project it is preferable to have the same engineers write the code as did the design. 5. In the context of software development, “implementation” refers to the actual writing of the code, using the design provided. 6. Software engineers use “OOP” as an acronym for “organized operational programming”. 7. The term “Javadoc” refers to the process of “doctoring” Java code so that it runs more efficiently. 8. Software engineers use “UML” as an acronym for “Unified Modeling Language”. 9. UML diagrams are used to represent classes and the relationships among them. 10. The “is-a” relationship between classes is called composition. 11. The “contains-a” relationship between classes is called aggregation. 12. The “has-a” relationship between classes is called inheritance. 1 Test Bank 2 13. A “mutable” class is one whose objects can be modified by the objects of other classes. 14. An extension...

Words: 1904 - Pages: 8

Free Essay

Differences Between C++ and Java

...Difference between C++ and JAVA:- 1. Java has no preprocessor. If you want to use classes in another library, you say Import and the name of the library. There are no preprocessors-like macros. 2. there are no pointers in the sense of C and C++. When you create an object with new, you get back a reference. 3. there are no destructors in Java. There is no “scope” of a variable per seen, to indicate when the object’s lifetime is ended-the lifetime of an object is determined instead by the garbage collection. 4. There is no GOTO statement in JAVA. 5. No INLINE methods. The java compiler might decide it’s own to inline a method, but you don’t have much control over this. You can suggest inlining in java by using FINAL keyword for a method. However , inline functions are only suggestions to the C++ compiler as well. 6. Java has method overloading that works virtually identically to C++ function overloading. 7. Java doesn’t create exe file after the execution of a program. 8. 9. > In Java, the sizes of int, long etc. are rigidly defined in terms of 10. > bits. In C++ they are platform−dependent. 11. > 12. > In Java, the JVM behaves at if it were big endian, even if internally 13. > it is actually little−endian. In C++, the endianness is platform 14. > dependent. 15. > 16. > In Java, garbage collection of unreferenced objects is automatic. In 17. > C++, you manually manage memory. 18. > 19. > In Java, references are constrained to point only to the beginnings of ...

Words: 1720 - Pages: 7

Premium Essay

Java

...Release Team[oR] 2001 [x] java Java 2: The Complete Reference by Patrick Naughton and Herbert Schildt Osborne/McGraw-Hill © 1999, 1108 pages ISBN: 0072119764 This thorough reference reads like a helpful friend. Includes servlets, Swing, and more. Table of Contents Back Cover Synopsis by Rebecca Rohan Java 2: The Complete Reference blends the expertise found in Java 1: The Complete Reference with Java 2 topics such as "servlets" and "Swing." As before, there's help with Java Beans and migrating from C++ to Java. A special chapter gives networking basics and breaks out networking-related classes. This book helps you master techniques by doing as well as reading. Projects include a multi-player word game with attention paid to network security. The book is updated where appropriate throughout, and the rhythm of text, code, tables, and illustrations is superb. It's a valuable resource for the developer who is elbow-deep in demanding projects. Table of Contents Java 2 Preface - 7 Part l The Java Language - The Complete Reference - 4 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 hapter 10 - The Genesis of Java - 9 - An Overview of Java - 20 - Data Types, Variables, and Arrays - 36 - Operators - 57 - Control Statements - 75 - Introducing Classes - 94 - A Closer Look at Methods and Classes - 111 - Inheritance - 134 - Packages and Interfaces - 156 - Exception Handling - 174 Chapter 11 - Multithreaded Programming...

Words: 78285 - Pages: 314

Premium Essay

Java Programming Language Sl-275

...Sun Educational Services Java Programming Language SL-275 Sun Educational Services Java Programming Language September 1999 Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun Logo, Solstice, Java, JavaBeans, JDK, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the...

Words: 6064 - Pages: 25

Free Essay

Java Basics

...1 Learn Java/J2EE core concepts and key areas With Java/J2EE Job Interview Companion By K.Arulkumaran & A.Sivayini Technical Reviewers Craig Malone Stuart Watson Arulazi Dhesiaseelan Lara D’Albreo Cover Design, Layout, & Editing A.Sivayini Acknowledgements A. Sivayini Mr. & Mrs. R. Kumaraswamipillai 2 Java/J2EE Job Interview Companion Copy Right 2005-2007 ISBN 978-1-4116-6824-9 The author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty either expressed or implied. The author will not be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Please e-mail feedback & corrections (technical, grammatical and/or spelling) to java-interview@hotmail.com First Edition (220+ Q&A): Dec 2005 Second Edition (400+ Q&A): March 2007 3 Outline SECTION DESCRIPTION What this book will do for you? Motivation for this book Key Areas index SECTION 1 Interview questions and answers on: Java Fundamentals Swing Applet Performance and Memory issues Personal and Behavioral/Situational Behaving right in an interview Key Points SECTION 2 Interview questions and answers on: Enterprise Java J2EE Overview Servlet JSP JDBC / JTA JNDI / LDAP RMI EJB JMS XML SQL, Database, and O/R mapping RUP & UML Struts Web and Application servers. Best practices and performance considerations. Testing and deployment. Personal and...

Words: 23255 - Pages: 94

Free Essay

Java

...Eclipse and Java for Total Beginners Tutorial Companion Document Eclipse And Java For Total Beginners Companion Tutorial Document By Mark Dexter Table of Contents Introduction........................................................................................................... .............................2 . Tutorial Target Audience.....................................................................................................................2 Tutorial Objectives..............................................................................................................................2 Why learn Java with Eclipse?.............................................................................................................3 Topics Covered...................................................................................................................................3 Tutorial Approach............................................................................................................... ................3 . Getting The Most From This Tutorial..................................................................................................3 Sample Java Application – Personal Lending Library........................................................................4 Downloading and Installing Eclipse ...................................................................................................4 Playing the Lessons...........................

Words: 7556 - Pages: 31

Free Essay

Dr Java

...A Quick Start Guide to DrJava A Quick Start Guide to DrJava Table of Contents 1. Introduction ................................................................................................................... 1 2. Getting Ready to Use DrJava ............................................................................................ 2 Downloading the JDK ................................................................................................. 2 Downloading DrJava ................................................................................................... 3 3. Using DrJava, the Basics ................................................................................................. 5 Running DrJava ......................................................................................................... 5 Opening and Creating Files .......................................................................................... 5 Saving Files .............................................................................................................. 6 Compiling Files .......................................................................................................... 6 The Interactions Pane .................................................................................................. 8 System.in .................................................................................................................. 9 Find and Replace ..........................

Words: 8211 - Pages: 33