|
In This Issue
Welcome to the Java Technology Fundamentals Newsletter This monthly newsletter provides a way for you to learn the basics of the Java programming language, discover new resources, and keep up-to-date on the latest additions to Sun Developer Network's New to Java Center. Note: For the code in this issue of Fundamentals to compile use the JDK 6 software.
Basic Java Technology Programming Passing Information to a Method or a Constructor The declaration for a method or a constructor declares the number and the type of arguments for that method or constructor. For example, the following is a method that computes the monthly payments for a home loan, based on the amount of the loan, the interest rate, the length of the loan (the number of periods), and the future value of the loan:
This method has four parameters: the loan amount, the interest rate, the future value, and the number of periods. The first three are double-precision floating point numbers, and the fourth is an integer. The parameters are used in the method body and at runtime will take on the values of the arguments that are passed in. Note : "Parameters" refers to the list of variables in a method declaration. "Arguments" are the actual values that are passed in when the method is invoked. When you invoke a method, the arguments used must match the declaration's parameters in type and order. Parameter Types
You can use any data type for a parameter of a method or a constructor.
This includes primitive data types, such as doubles, floats, and
integers, as you saw in the
Here's an example of a method that accepts an array as an argument.
In this example, the method creates a new
Note : The Java programming language doesn't let you pass methods into methods. But you can pass an object into a method and then invoke the object's methods. Read the rest of this tutorial Object as a Superclass
The
The
Read the rest of this tutorial Creating and Editing Files Each month, this section highlights articles and tutorials to teach you about the Java technologies involved in desktop application development and the tools that you can use to create various types of desktop applications. Last month, you read the article "GUI Building in NetBeans IDE 5.5." This month, you'll learn about creating and editing source code in the NetBeans integrated development environment (IDE). Creating and editing Java source code is the most important function that the IDE serves, since that's what developers generally spend most of their day doing. NetBeans IDE provides a wide range of tools that can complement any developer's style, regardless of whether you prefer to code everything by hand or want the IDE to generate large chunks of code for you. This tutorial covers the following topics:
NetBeans IDE 5.x Tutorial for Applets Each month, this section will highlight articles to get you familiar with the Java technologies involved in server-side development and the tools you can use to create various types of web applications. Last month, you learned about using the NetBeans IDE for creating web applications. Now, you are going to learn about creating applets in the NetBeans IDE. Though there are no project templates that are specifically designed for creating applets in NetBeans IDE 5.x, you can easily develop them in a Java project and package them in a web project. The application that you build in this tutorial guides you through the following activities in NetBeans IDE 5.x:
This tutorial can be completed in 20 minutes. Sun is offering the award-winning Sun Java Studio Enterprise and Sun Java Studio Creator IDEs at no cost to all developers worldwide who join the Sun Developer Network (SDN). Self-Paced Web, CD, and Virtual Courses
Fundamentals of the Java Programming Language (WJB-110A) Java Programming Language Workshop (VC-SL-285)
Developing Applications for the J2EE Platform (CDJ-310A)
| |||||||||||||
|
| ||||||||||||