Java Programming, Loose-leaf Version
Java Programming, Loose-leaf Version
8th Edition
ISBN: 9781337685917
Author: Joyce Farrell
Publisher: Cengage Learning
Question
Book Icon
Chapter 3, Problem 1PE

a.

Program Plan Intro

Given:

Variables declared:

int a = 5;

int b = 6;

Method defined:

public static void mathMethod(int a)

Here, the method “mathMethod()” is defined with integer variable as an argument.

b.

Explanation of Solution

mathMethod(b);

“mathMethod(b)” is considered as legal because it is called with ...

c.

Explanation of Solution

mathMethod(a + b);

“mathMethod(a+b)” is considered as legal because it is called with the variable “a&...

d.

Explanation of Solution

mathMethod(a , b);

“mathMethod(a,b)” is con...

e.

Explanation of Solution

mathMethod(2361);

“mathMethod(2361)” is cons...

f.

Explanation of Solution

mathMethod(12.78);

“mathMethod(12.78)” is cons...

g.

Explanation of Solution

mathMethod(29987L);

“mathMethod(29987L)” is con...

h.

Explanation of Solution

mathMethod();

“mathMethod()” is co...

i.

Explanation of Solution

mathMethod(x);

“mathMethod(x)” is co...

j.

Explanation of Solution

mathMethod(a / b);

“mathMethod(a/b)” is considered as legal because it is called with the variable “a...

Blurred answer
Students have asked these similar questions
How can I create a method for an object of another class? Here's my method code:     public Rental higherRent(Rental obj1, Rental obj2){       if(obj1.getHoursAndMinutes() > obj2.getHoursAndMinutes())         return obj1;       else if(obj1.getHoursAndMinutes() < obj2.getHoursAndMinutes())         return obj2;       else         return obj1;It's giving me this error:Main.java:43: error: illegal start of expressionpublic Rental higherRent(Rental obj1, Rental obj2){Attaching images below.
1).  What will be returned from the following method? public static double methodXY() {    double a = 6.5 + 8.5;    if( a  >  12)       return a;    else       return 10; }
What value is returned from the following method?   public static double methodA() {       double a = 8.5 + 9.5;       return a; }
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage