Shared Flashcard Set

Details

csa 174
exam 3
10
Computer Science
Undergraduate 1
11/18/2008

Additional Computer Science Flashcards

 


 

Cards

Term
methods
Definition
sub-program that performs a specified task
Term
Types of methods
Definition
Static,Non-static,Constructors
Term
void methods
Definition
do not return any values and cannot be used in mathematical expressions. (used to develop sub-programs)
Term
non-static methods
Definition
must be called via an object whose data type is the class in which the method is defined.
String s1="Hello"
String s2=s1.toLowerCase()
Term
non-void methods
Definition
return values and are used in mathmatical expressions

double d=Math.sin(Math.cos(10))
String s=keyboard.next()
Term
static methods
Definition
must always be called on in the class in which the method is defined.

double d=Math.sin(10)
Term
public static double abs(double a)

what does each term mean
Definition
public static double abs(double a)
Interpretation of signature
static method
Name of method is abs
Requires 1 double value for parameter a
Returns a number of data type double
Term
calling a method
invoking a method
Definition
using that method
Term
Call the method abs with the following signature: public static double abs(double a)
Definition
Possible valid method calls in Math:
Math.abs(-3.142);
// Value for parameter a is -3.142
Math.abs(0.5 + b * 0.1);
// Value for parameter a is number from formula 0.5 + b * 0.1
Term
call to abs within math class
Definition
Math.abs(10)
Supporting users have an ad free experience!