Java Concepts Chapter 2:Using Objects
Rules for identifiers:
-can be made up of letters, digits, and the underscore character; however, they cannot begin with a digit. -You cannot use symbols or spaces. -You cannot use reserved words like public -identifiers are case sensitive
awt stands for
Abstract Windowing Toolkit
A method name is overloaded if...
a class has more than one method with the same name (but different parameter types)
By convention, variable names should start with
a lowercase letter
method that does not change the state of its implicit parameter
accessor method
describes the location of the object
an object reference
Class names should start with
an uppercase letter
the assignment operator (=) is used to
change the value of a variable
What does the length method do?
counts the number of characters in a string ex. String greeting = "Hello, World!"; n = greeting.length(); (n is then set to 13)
What does the toUpperCase method do?
creates another string object that contains the characters of the original string, with lowercase letters converted into uppercase letters ex. String river = "Nile"; String bigriver= river.toUpperCase();
parameter of the method other than the object the method invokes and is enclosed in parentheses
explicit parameter ex. in dave.setJobTitle("Candlestick Maker"); "Candlestick Maker" is the explicit parameter (dave is the implicit parameter)
the double type denotes...
floating-point numbers that can have fractional parts
Name of a variable, method, or class
identifier
Object on which the method is invoked
implicit parameter ex. in System.out.println(greeting), System.out is the implicit parameter
a sequence of instructions that accesses the data of an object
method
A method whose purpose is to modify the state of an object
mutator method
store numbers
number variables
store references
object variables
entities in your program that you manipulate by calling methods
objects
a collection of classes with a related purpose
package
An input to a method
parameter
In Java, number types are
primitive types, not classes
A result that the method has computed for use by the code that called it
return value
Carries out a search and replace operation
the replace method
In Java to write numbers in exponential notation...
using the notation En, for example, 1.4E-4
When a method returns no value it is
void ex. public void println(String output)