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


Please Help Members By Posting Answers For Below Questions

What is a lock or purpose of locks in java?

581


How many types of exception can occur in a java program?

526


What is your platform’s default character encoding?

549


What is ‘has a’’ relationship in java?

716


Why is stringbuffer faster than string?

480






What is a line separator in java?

530


How do you implement polymorphism in our day to day life?

2756


What do you understand by weak reference?

548


How to perform bubble sort in java?

582


Explain about strings in java?

609


what is the difference between yielding and sleeping? : Java thread

516


What is split return?

486


Which is faster call by value or call by reference?

493


What is a war file?

536


What is yield () in java?

476