CodesJava

Easy learning with example program codes

Get system hostname in java

Get system hostname in java

package com.codesjava;
 
import java.net.InetAddress;
 
public class NetworkingTest {
  public static void main(String args[])
Read More

Get ip address in java

The java.net.InetAddress class represents an IP address. It provides the methods to work with IP and host name.

Get ip address in java

package com.codesjava;
 
Read More

Decode url in java

Decode url in java

package com.codesjava;
 
import java.net.URLDecoder;
 
public class URLTest {
  public static void main(String args[]){
Read More

Encode url in java

Encode url in java

package com.codesjava;
 
import java.net.URLEncoder;
 
public class URLTest {
	public static void main(String args[]){
Read More

Compare two urls in java

Compare two urls in java

package com.codesjava;
 
import java.net.MalformedURLException;
import java.net.URL;
 
public class URLTest {
  public static void main(String args
Read More

Create relative url in java

Create relative url in java

package com.codesjava;
 
import java.net.MalformedURLException;
import java.net.URL;
 
public class URLTest {
  public static void main(String args
Read More

Read url properties in java

MethodDescription
getProtocol()It returns the protocol of the URL.
getHost()It returns the host name of the URL.
getPort()It returns the Port Number of the
Read More


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki