Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Anurag Verma

Ranch Hand
+ Follow
since Mar 30, 2012
Anurag likes ...
Hibernate Spring Ubuntu
Pune, India
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
12
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anurag Verma

Welcome to Coderanch. This looks pretty much like an academic assignment. Where are you stuck for completing this? Do you see any errors in your program??
1 year ago
Yet another recommendation would be to declare the class having main method as public.
3 years ago
Static members are independent, lets define independency here.

For static variables, the space for a static variable is not allocated inside the instance of class. ie if you create an object of a particular class with some static & non static variables, all non static variables will get space inside every instance, but static variables get space in the JVM memory outside the instance & has single presence. static variable will be same for all the instances of class.

For static methods, you can call them directly using the class name & you don't need an instance for calling. the "Function Activation Record" or stack frame creation for all the methods is same & never changes.

So basically the term "independant" means independent of the "instance" that you have or may create. Hope that answers...
4 years ago
Not sure if volatile is really needed here, your code looks good still would suggest small improvements -
4 years ago
Inside your if statement with YES_OPTION, call main again. Skip other options of no and cancel as you are not doing anything there and there is nothing to execute after your option checks.
4 years ago
as clear from the message itself the request you are sending is not correct, probably the service URI or the parameters required are not being sent correctly.
4 years ago
You can try debugging and inspecting the variable len1 in the ide to figure out what exactly was returned.
4 years ago
Try reading a little about constructor and static block as Knute Snortum has already suggested.....surely you'll get your answers.
4 years ago
Instead of adding the jar, you should be adding a dependency in pom for every missing library, maven will take care of adding all other libraries which are needed by the one you added. Also when you share the project you don't need to share any of the jars, just share the project folder, keep only the src folder and pom.xml, everything else will be created by the ide.
4 years ago
Single instance (this) only.
replace 1.6 with the version of java you want to work on
4 years ago
Add your Spring dependencies into the jar as already mentioned earlier in steps to use maven. (every time you get a class not found, look for the maven dependency of it in mvnrepository and add it to pom.xml

replace your plugin node in pom.xml with this for referring correct java version-


We should not be using group id of some other organization for our own applications. you can probably have it as com.kristian or just kristian. Using the groupId of other organizations is technically correct, but ethically wrong.
4 years ago