Error Java 39
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up java:39: cannot find symbol symbol : method exponent(double,int) else { return base * exponent(base, exponent - 1);} [closed] up vote 0 down vote favorite import java.util.Scanner; public class TaylorSin { /* I am trying to approximate sin(x) using Maclaurin Series... I am trying to get 1 term (1 Step Towards my approximation) the exponent divided by a factorial... However I get stuck in the calculateExponent method... Thank You in Advance! */ public static void main(String[] args) { Scanner Keyboard = new Scanner(System.in); double base; int exponent, n; System.out.println(); System.out.println("Enter Base: "); base = Keyboard.nextDouble(); System.out.println("Enter Exponent: "); exponent = Keyboard.nextInt(); System.out.println("Enter n: "); n = Keyboard.nextInt(); System.out.println(); System.out.println(calculateTerm(2.0, 4, 2)); } public static int calculateFactorial(int n) { int facto = 1; for (int i = 1; i <= n; i++) {facto = facto * i;} return facto; } public static double calculateExponent(double base, int exponent) { if(exponent == 0){return 1;} else { return base * exponent(base, exponent - 1);} //The mistake occurs on that line... } public static double calculateTerm(double base, int exponent, int n) { double term = (calculateExponent(base, exponent)/calculateFactorial(n)); return term; } } java methods compiler-errors symbols share|improve this question edited Feb 10 '13 at 7:01 Pang 5,197134573 asked Feb 10 '13 at 6:30 user2058291 143 closed as too localized by casperOne Mar 12 '13 at 11:36 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. add a comment| 2 Answers 2 active oldest votes up vote 2 down vote Instead of else { retur
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Java: '.class' expected error when passing array to function [closed] up vote 0 down http://stackoverflow.com/questions/14795327/java39-cannot-find-symbol-symbol-method-exponentdouble-int-else-return-b vote favorite I'm taking a java class, but have been away from it for a bit. Trying to get this sorting program to work: import java.util.*; public class Assignment1 { private int[] nums; private int[] ast; private int n; public void sort(int[] vals) { this.nums = vals; n = vals.length; this.ast = new int[n]; merges(0, n - 1); } private void merges(int bot, int top) { if (bot < top) http://stackoverflow.com/questions/21947455/java-class-expected-error-when-passing-array-to-function { int mid = bot + (top - bot) / 2; merges(bot, mid); merges(mid + 1, top); merge(bot, mid, top); } } private void merge(int bot, int mid, int top) { for (int i = bot; i <= top; i++) { ast[i] = nums[i]; } int i = bot; int j = mid + 1; int k = bot; while (i <= mid && i <= top) { if (ast[i] <= ast[j]) { nums[k] = ast[i]; i++; } else { nums[k] = ast[j]; j++; } k++; } while (i <= mid) { nums[k] = ast[i]; k++; i++; } } private void show() { System.out.print("Sorted Array: "); for(int l=0;l WorkSocial MediaSoftwareProgrammingWeb Design & DevelopmentBusinessCareersComputers Online Courses B2B Solutions Shop for Books San Francisco, CA Brr, it´s cold outside Search Submit Learn more with dummies Enter your email to join our mailing list for FREE content http://www.dummies.com/programming/java/tackling-error-messages-in-java-programming/ right to your inbox. Easy! Your email Submit RELATED ARTICLES Tackling Error Messages in Java Programming JavaFX For Dummies Java Programming for Android Developers For Dummies Java For Dummies, 6th https://youtrack.jetbrains.com/issue/TW-45494 Edition Java For Dummies Quick Reference Load more ProgrammingJavaTackling Error Messages in Java Programming Tackling Error Messages in Java Programming Related Book Beginning Programming with Java For Dummies, 2nd error java Edition By Barry Burd Sometimes, error messages can strike fear into the heart of even the bravest programmer. Fortunately some helpful, calming advice is here -- advice to help you solve the problem when you see one of these messages. NoClassDefFoundError You get this error when you're trying to run your code. So first ask yourself, did you attempt error java 39 to compile the code? If so, did you see any error messages when you compiled? If you saw error messages, look for things you can fix in your .java file. Try to fix these things, and then compile the .java file again. If you normally keep code in the JavaPrograms directory, make sure that you're still working in this JavaPrograms directory. (In Windows, make sure that the command prompt says JavaPrograms.) Make sure you have an appropriately named .class file in your working directory. For instance, if you're trying to run a program named MyGreatProg, look for a file named MyGreatProg.class in your working directory. Check your classpath to make sure that it contains the .class file that you need. For example, if all your Java code is in your working directory, make sure that the classpath includes a dot. NoSuchMethodError When you encounter this error message, check for the misspelling or inconsistent capitalization of a method name. Check the capitalization of main (not Main). When you issue the java command (or do whatever you no