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

Is integer immutable in java?

549


What is a class reference?

555


What are internal and external variables?

546


What are assembly attributes?

547


What is dynamic binding(late binding)?

588






What is the arraylist in java?

530


What is a pointer and does java support pointers?

559


Can we overload run() method in java?

599


Explain numeric promotion?

598


Is array dynamic in java?

483


Is array size fixed in java?

542


what is meant by Garbage collection?

619


Is it possible to instantiate the abstract class?

540


what are three ways in which a thread can enter the waiting state? : Java thread

578


How can we make a class virtual?

644