|
-
Aug 7th, 2012, 03:23 PM
#1
Thread Starter
Addicted Member
[RESOLVED] illegal modifier for <method>, only final is permitted
good afternoon all!
Its been a long time since I've posted here and I've decided to try and relearn a language or two and I've set off on my journey by picking up the deitel Java book and just opening it up to a couple of the early chapters to relearn everything from program organization to "schhol house" level coding and I've come across my first unexplainble issue. I'm using the latest and greatest JUNO eclipse and I've written very very small stuff regarding number manipulation and simple math.
I wanted to write a method inside my main for calculating the diff of two numbers and I thought it would be simple enough but then again it isn't as it seems.
This is as far as I've gotten:
Code:
public static int calcDiff(int first, int second){
}
Eclipse is barking about illegal modifiers for calcDiff by saying exactly what the title says and to be honest I don't know what to do to fix this. I've looked a little bit and nothing on the web really gives me a hand because all the answers I find pertain to properly scoping variables. I figured I'd come here and see if someone had a good resource for issues such as this because I'm pretty sure this isn't going to be the first one I have hehe. No rush on this, nothing is due, not in college or highschool, just trying to relearn java because over the years I have COMPLETELY lost it hehe. I'm going to keep lookin through the deitel book and I'll check back periodically.
thanks,
abe
Abrium
Asking the beginners questions so you don't have to!
If by chance hell actually froze over and I some how helped you... Please rate.
-
Aug 7th, 2012, 03:42 PM
#2
Thread Starter
Addicted Member
Re: illegal modifier for <method>, only final is permitted
so, I'm trying to create that method inside my main method and that is a no-no I guess?
Abrium
Asking the beginners questions so you don't have to!
If by chance hell actually froze over and I some how helped you... Please rate.
-
Aug 7th, 2012, 03:50 PM
#3
Thread Starter
Addicted Member
Re: illegal modifier for <method>, only final is permitted
Yep, was inside the main method, my mistake. Then I played hell trying to understand the logic of keeping it completely seperated from main but within the same class... man I'm rusty!
Abrium
Asking the beginners questions so you don't have to!
If by chance hell actually froze over and I some how helped you... Please rate.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|