Anurag Verma

Ranch Hand
+ Follow
since Mar 30, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

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??
6 years ago
Yet another recommendation would be to declare the class having main method as coderanch.
7 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...
8 years ago
Not sure if volatile is really needed here, your code looks good still would suggest small improvements -
9 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.
9 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.
9 years ago
You can try debugging and inspecting the variable len1 in the ide to figure out what exactly was returned.
9 years ago
Try reading a little about constructor and static block as Knute Snortum has already suggested.....surely you'll get your answers.
9 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.
9 years ago
Single instance (this) only.
replace 1.6 with the version of java you want to work on
9 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.
9 years ago