I want to know the host name and provider name for tcs web
mail
Answer Posted / shaik baji
import java.net.*;
class GetIPAddress
{
public static void main(String[] args) throws
Exception
{
InetAddress obj = InetAddress.getLocalHost
();
String ipAddress=obj.getHostAddress();
System.out.println(ipAddress);
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
Can java cast null?
What is sleep method?
What are the two categories of data types in the java programming language?
What is sortedmap in java?
Can java inner class be static?
Explain notifyall() method of object class ?
Which number is denoted by leading zero in java?
Java openings 3 - 5 years, Lnt Infotech. requirements - core java, J2ee, struts, hibernate Interview Date:- 19 March 2011 Time:- 9:00 AM to 12:00 Pm Interview Location - L & T Infotech, Manapakkam, Chennai Refererral PS NO:- 291649 (Please mention this when u fill the form only then u will be considered for interview) Documents Required:- Latest Resume, Photograph and last 3 payslips Mail me on vasan2211@gmail.com once u appear for interview
What variables are stored in stack?
How do you take thread dump in java?
Explain the difference between jvm and jre?
Is it necessary that each try block must be followed by a catch block?
What is a copy constructor in java?
Why java is said to be pass-by-value ?