Gaurangkumar Khalasi

Ranch Hand
+ Follow
since Jun 02, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gaurangkumar Khalasi

Use something like following:

List<adw> localList = this.o.a(adw.class, aQ().b(1.0D, 0.0D, 1.0D)); // If you know that your method always returns list of objects of class adw.

for(adw localadw : localList) {...}

Error comes because List localList is a list of Objects and you try to iterate over localList and want to get adw objects; which is not their.

You can also do following:

List localList = this.o.a(adw.class, aQ().b(1.0D, 0.0D, 1.0D));
for (Object o : localList) {
adw localadw = (adw) o;
3 years ago
What is "hidetable()" function??? Maybe problem arise because of it!!!
5 years ago
Try out following:

5 years ago

Bhargav Patel wrote:...whts problem with it?

5 years ago

gurpeet singh wrote:you cannod do ServletConfig sc = new GenericServlet() as well as new HttpServlet(); since both GenericServlet and HttpServlet are abstract classes.

Maybe with anonymous inner class definition of those abstract classes!!...
ServletConfig is an Interface, can't be instantiated.
GenericServlet and HttpServlet implements ServletConfig, So they have to give implementation to the abstract methods of it.

init(ServletConfig) and init() methods are two initialization methods.

If you think that with init(ServletConfig) method; Servlet get the Object of ServletConfig through Servlet Container, then Have you think how the Container create that Object? (Maybe ServletConfig sc = new GenericServlet(); OR new HttpServlet();)

Also, think about if you can initialize servlet with init(), then Servlet can also able to get ServletConfig object through getServletConfig() method (How it will get that Object?).
Because of inheritance...

Exc0 e0 = new Exc1();
5 years ago

Singh Kuldeep wrote:Please some body tell number of object actually created in the above program.

I think you have to get brief introduction about Reference and Object.
5 years ago
Cloud computing is NOT a technology.

Cloud computing is a concept which will be a part of Distributed Computing/Parallel Computing...With that anyone can develop applications without any hardware premises...they have to just subscribed the services from the particular Cloud Service Provider and use the provider's platform specific API(based on java, .net, php, etc.) to make the application...after the development of application...where its data is located, where the server is running, who are using that application, etc...those questions are unanswered to the application there is a security and privacy risk ,many researches are going on for that (may solutions will be available???) ....also Cloud service provider charge based on the usage of various services to its client...

If one wants to run its java application to the cloud, than he/she have to make some required changes(if any) based on cloud service provider's platform.
5 years ago

Have you cleared OCPJP 6?
5 years ago
Put "try{c.wait();}catch(Exception e){} " outside the for loop.

Henry Wong wrote:... There is a common sense reason why instance variables can't be accessed from a static context -- the static context doesn't have access to a "this" variable. If you understand the reason, then you can understand how you can get around the issue, either by using another instance besides the "this" instance, or passing the value via another means, such as a parameter. etc.

As jay sugrue can not distinguish between "pass by value"(E.1) and "pass by reference", i have put my first Q.1 about Parameter Passing for him (So, he will get the idea himself... ).


And second Q.2 about "referenced" word from the sentence " non-static variable x cannot be referenced from a static context."(i.e. Compiler Error; Get when try to compile E.2), so that he can able to figure out (if he try to search for it ) that in E.2, the sentence "System.out.println(x);" is equivalent to "System.out.println(this.x);" i.e. x is referenced by the 'this' variable.
But whatever it is...Might he got the answers!!! ... And also thank you for your response...
5 years ago

jay sugrue wrote:...why then can an instance variable be passed into this static context - is that not against the rules ?

Q.1). Have you know about "Parameter Passing" in java?
Your main issue: non-static variable x cannot be referenced from a static context.
Q.2). What is the meaning of "referenced"?
If you get the information about Q.1 and Q.2, you will get the idea...
5 years ago

shivam singhal wrote:"classpath is not recognized as an internal or external command operable program or batch file" during compiling the servlet
in cmd as::
javac -classpath /tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/

For Windows 7:
From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables. In the section User Variables, find the CLASSPATH environment variable and select it. Click Edit. If the CLASSPATH environment variable does not exist, click New.
In the Edit User Variable (or New User Variable) window, specify the value of the CLASSPATH environment variable(in your case, full path of the servlet-api.jar). Click OK. Close all remaining windows by clicking OK.
Restart the CMD and try again your task.

For more details ("How to on Linux, Windows XP, Solaris?") Click here
5 years ago