Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Waiting for ur quick response
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


SARATHKUMAR M
Waiting for ur quick response
0 Answer(s)      2 years and 3 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!!!


Advertisement
View Answers

Related Tutorials/Questions & Answers:
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
Advertisements
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
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
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
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
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
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
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
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
Quick Sort in Java
Quick Sort in Java Quick Sort in Java is used to sort elements of an array. Quick sort works on divide and conquer strategy and comparison sort... into two sub-arrays. The complexity of quick sort in the average case is &Theta
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
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
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
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
 

 

 

DMCA.com