Home Answers Viewqa Java-Beginners Waiting for ur quick response

 
 


SARATHKUMAR M
Waiting for ur quick response
0 Answer(s)      8 months ago
Posted in : Java Beginners

Hi,

I have two different java programs like sun and moon. In both of these two programs i have used same class name like A. For example,

File name:sun.java
Then the code is here:
Class A
{
public static void main(String args[])
{
System.out.println("Hai");
}
}

Then i have to compile it:

javac sun.java
It compiles successfully then i have to run it
java A
The output is: Hai
This part is completed. Now i ll go to the next program

File name:moon.java
Then the code is here:
Class A
{
public static void main(String args[])
{
System.out.println("Hello");
}
}

Then i have to compile it:

javac moon.java
It compiles successfully then i have to run it
java A
Now the output is: Hello

Now i want to get the result as "Hai", so i run the file named as sun.java.
But this time again i got the result as "Hello"
What is the reason for this type of happening? and what is the solution for this problem? and how will i get the output "Hai"? Please any one help me ASAP....

Thanks!!!

View Answers









Related Pages:
Waiting for ur quick response
Waiting for ur quick response  Hi, I have two different java programs like sun and moon. In both of these two programs i have used same class name like A. For example, File name:sun.java Then the code is here: Class
Hi and Thanks for ur response - Hibernate
Hi and Thanks for ur response  Hi, thanks for ur immediate response.Could anyone know abt the elements generated by generic DAO classes and pls let me know what is persistenceInstance with one good example. pls explain me
i need a quick response about array and string...
i need a quick response about array and string...  how can i make a dictionary type using array code in java where i will type the word then the meaning will appear..please help me..urgent
Tomcat Quick Start Guide
Tomcat Quick Start Guide       This tutorial is a quick reference of starting development application using JSP, Servlets and JDBC technologies. In this quick and very
s per ur answer
s per ur answer  i cannot understand please explain in detail 3)Create web.xml and classes folder inside the WEB_INF folder of web application folder.   Hello Friend, We were explaining you the directory structure
quick sort
quick sort  sir, i try to modify this one as u sugess me in previous... static void quick_srt(int array[],int low, int n){ int lo = low; int hi... = lo; lo = T; } quick_srt(array, low, lo); quick_srt(array
quick sort
quick sort  sir, i try to modify this one as u sugess me in previous... static void quick_srt(int array[],int low, int n){ int lo = low; int hi... = lo; lo = T; } quick_srt(array, low, lo); quick_srt(array
quick sort
quick sort  sir, i try to modify this one as u sugess me in previous... static void quick_srt(int array[],int low, int n){ int lo = low; int hi... = lo; lo = T; } quick_srt(array, low, lo); quick_srt(array
How to extract values from SOAP Response message and insert in database
please help me on this? Your quick response will be highly appreciated...How to extract values from SOAP Response message and insert in database ... values from SOAP Response XML (i.e. Empname,EmpID,Phnumber) but I don't have any
Reply to ur mail(Hibernate Error)
Reply to ur mail(Hibernate Error)  Hi! Im using Eclipse. Steps : 1. Downloaded the example code and library from rose india and extracted the content in a directory. 2. Downloaded file contains the Eclipse project. 3. Started
diplay response
diplay response   Sir, How show sum of two tex boxes data to third box   Answer
How to make one waiting thread for lock - Java Beginners
How to make one waiting thread for lock  Hi Friends, I am new to java. Can u explain about thread concept.How i know one thread is locked, and how can i force or acquire another thread for lock . Finally how to know thread
JSP Response Object
JSP Response Object  JSP response Object ?   The response object denotes the HTTP Response data. The result or the information of a request is denoted with this object. The response object handles the output
php parse soap response
php parse soap response  What is soap and how can i convert a soap response to XML. Thanks in Advance
Struts Quick Start
Struts Quick Start Struts Quick Start to Struts technology In this post I will show you how you can quick start the development of you struts based project... of the application fast. Read more: Struts Quick Start
Quick Sort In Java
Quick Sort in Java      ... to sort integer values of an array using quick sort. Quick sort algorithm is developed by C. A. R. Hoare. Quick sort is a comparison sort. The working
Please help need quick!!! Thanks
Please help need quick!!! Thanks  hey i keep getting stupid compile errors and don't understand why. i'm supposed to use abstract to test a boat race simulation program of sorts here is my code: RentforthBoatRace.java public
problem in forwarding response
problem in forwarding response  My response is not getting displayed. i have used RequestDispatcher.forward,RequestDispatcher.include...,Update page has fields with the values.after user clicks on update button,response
Server_Gives_Null_Response
at port 6066. My Problem is that when i send response from server (port 6066... the server. Kindly give the solution how can i get response at client class. I
Quick Sort in Java
Quick sort in Java is used to sort integer values of an array. It is a comparison sort. Quick sort is one of the fastest and simplest sorting algorithm... sort, etc. The complexity of quick sort in the average case is Θ(n log n
how to display response in request page
how to display response in request page  Sir/Mom, My request page have three text boxes. Enter register number in the first box then click the submit button.This time shows the name and mark to display the second and third boxes
simple ajax Request and Response code...
simple ajax Request and Response code...  var request=null; if (window.XMLHttpRequest) { request = new XMLHttpRequest(); } else if (window.ActiveXObject) { request = new ActiveXObject("Microsoft.XMLHTTP"); } if(request
Adv. Help! Console messenger. How to anticipate if the user is writing something or just waiting for messages
Console messenger. How to anticipate if the user is writing something or just waiting for messages  A console that acts as messenger. The app is Client/Server architecture. The app look for a messenger from other host and shows
Response Filter Servlet Example
Response Filter Servlet Example       This Example shows how to use of response filter... to the response. Use the init-param child element of the filter element to declare
Fleet Management of Medical vans/ambulance
Of late, fleet management of medical vans/ambulance has become critically important. This fleet needs quick response, have to be available at any time of the day, month and year and at every place. Such medical vans or ambulance save
Writing Quick Articles Using Information in Public Domain
Writing Quick Articles Using Information in Public Domain       Books, articles as well as other materials available in the public domain help in providing finished works which
how to display webservice response in a text box
how to display webservice response in a text box  Hallo, i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a text box usinj
Access Request and Response
the request and response object in struts 2 application. To access the request... and to access the response object, use the ActionContext or implement... action class. Accessing the request and response object, you need a struts.xml
Java Servlet : Http Response Headers
Java Servlet : Http Response Headers In this tutorial, you will learn how to Http Response Headers works in java servlet. Http Response Headers : Web server sends response with one or more response headers including the document
web page altering while displaying servlet response
and i want to display response of that servlet in a div in my index.jsp...(request, response); i have used this code but it is not displaying the page
Send a Response Status in servlet
.style1 { font-weight: bold; } Send a Response...; This section illustrates you how to send response status in servlet. All Response status is defined in HttpServletResponse Class. You can then use constants
XML response correct in broser but incorrect in Java
XML response correct in broser but incorrect in Java  Firs of all I want to say that I was able to read XML response from URL. Thank you for this and many other helps. I read and printed the response (code below) but the result
JSP:NEED RESPONSE ASAP PLEASE! - JSP-Servlet
JSP:NEED RESPONSE ASAP PLEASE!  Hi freind, If you could respond to my previous thread which hasn't been addressed for over a week, I'd really appreciate it. and most important if you could just respond to below. thank you I
Servlet Response Send Redirect - JSP-Servlet
Servlet Response Send Redirect  Hi, Thank you for your previous answer, the code works great. Sorry to bother you guys and perhaps this would be one of my last questions as I am almost finish with my web medical clinic app
getOutputStream() has already been called for this response
called for this response. here is my jsp code: <%@ page import... form, HttpServletRequest request, HttpServletResponse response
Quick introduction to web services
Quick introduction to web services         Introduction: Web services are becoming more and more popular. Web Services allows you to expose
The quick overview of JSF Technology
JSF Overview          The quick Overview of JSF Technology This section gives you an overview of Java Server Faces technology, which
calling servlet from JS and return response from servlet to JS
calling servlet from JS and return response from servlet to JS  hello all, I am working on JSP-servlets n MVC.I am facing a problem. on the web page when user clicks on a button i am calling a javascript function(eg myFunc
Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1 - JavaMail
Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1  package beans; import java.io.*; import java.util.*; import javax.mail....: 465, response: -1"..... send me solution of this . ritesh thank you
Exception: java.lang.IllegalStateException: getWriter() has already been called for this response - JSP-Servlet
Exception: java.lang.IllegalStateException: getWriter() has already been called for this response    response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); Statement st1
JSP implicit object "response"
;response' object , reply is sent back to the browser. It is an implicit object of class "HttpServletResponse" class and using this object, response parameters can be modified or set. The response object handles
How to make Time picker in Java Swing
in advance . waiting for ur reply...How to make Time picker in Java Swing  Hello Sir, Thank u so much for such a quick reply . I followed date picker tutorial and completed
How to make Time picker in Java Swing
in advance . waiting for ur reply...How to make Time picker in Java Swing  Hello Sir, Thank u so much for such a quick reply . I followed date picker tutorial and completed