Results 1 to 5 of 5
Thread: Intresting Program
- 04-28-2012, 12:47 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 2
- Rep Power
- 0
Intresting Program
Check out this program! It s giving an error!
__________________________________________________ __________________________________
import java.util.*;
class calculate
{
static float mult(float a,float b)
{
return (a * b);
}
static float divide(float c, float d)
{
return (c / d);
}
}
class pa
{
public static void main(String args[])
{
float x1 = calculate.mult(2.0,4.0);
float x2 = y.divide(2.0,4.0);
System.out.println(x1);
System.out.println(x2);
}
}__________________________________________________ ___________________________
Please help!
- 04-28-2012, 12:52 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Re: Intresting Program
What is 'y'?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-28-2012, 01:31 PM #3
Uninteresting Program
BB Code List - Java Programming Forum
Use a meaningful subject line. Nothing interesting about the program either.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-02-2012, 07:56 AM #4
Member
- Join Date
- Apr 2012
- Posts
- 2
- Rep Power
- 0
Re: Intresting Program
Sorry my mistake!
Its not -> float x2 = y.divide(2.0,4.0);
Its -> float x2 = calculate.divide(2.0,4.0);
- 05-02-2012, 08:04 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
How to code a program to send messages to a chat program?
By josh2992 in forum New To JavaReplies: 2Last Post: 04-02-2011, 12:57 PM -
How would I open a program from a single button of another program. Help...
By decgaid06 in forum New To JavaReplies: 13Last Post: 03-22-2011, 06:49 AM -
changing my program to array working program
By Chewart in forum New To JavaReplies: 39Last Post: 11-18-2009, 06:53 PM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks