Question: java please 24.) Extra Credit: Write a static method called is PowerOfTwo that takes an integer n as an argument and that returns true if
24.) Extra Credit: Write a static method called is PowerOfTwo that takes an integer n as an argument and that returns true if n is a power of two, and false otherwise. (Note that is PowerOfTwo(1) should return true, since 2 = 1.) Examples: isPowerOfTwo(0) returns false isPowerOfTwo(1) returns true isPowerOfTwo(X) returns false isPowerOfTwo(8) returns true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
