I want to know the host name and provider name for tcs web
mail
Answers were Sorted based on User's Feedback
Answer / deepak divvela
String hostname=Inetaddress.getAddress("portno of tcs
mail").getHostName();
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / abhilash
String hostname= InetAddress.getByName("portno of tcs
mail").getHostName();
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / ajay agarwal
String hostname=Inetaddress.getAddress("portno of tcs
mail").getHostName();
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Answer / ss
String ipAddress=InetAddress.getByName
("www.tcs.com").getHostAddress();
| Is This Answer Correct ? | 0 Yes | 2 No |
How to initialize an Applet ?
What is the main difference between java platform and other platforms?
How do you reverse sort a list in java?
Can you use abstract and final both with a method?
What are different types of access modifiers?
What modifiers can be used with a local inner class?
Why java is considered as platform independent?
Can we extend singleton class in java?
What is the default value stored in Local Variables?
what are three ways in which a thread can enter the waiting state? : Java thread
what is AWT
Does constructor creates the object ?