Thread: Source Code
View Single Post
  #5 (permalink)  
Old February 22nd, 2006, 07:32 AM
ShafiChaudhry ShafiChaudhry is offline
Registered User
 
Join Date: Feb 2006
Location: Karachi, Sindh, Pakistan.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You are missing import statement. Try the following code. It will work; however use of System.in needs thorough knowledge of streams/buffers/channels.

import static java.lang.Math.*;
public class Test {
public static void main(String[] args) {
int base = 2;
int power = 5;
System.out.println(base+" power "+ power + " = "+pow(2,5));
}
}
Reply With Quote