In: Computer Science
Given a String variable address, write a String expression consisting of the string "http://" concatenated with the variable's String value. So, if the variable refers to "www.turingscraft.com", the value of the expression would be "http://www.turingscraft.com". in java
Expression in Java:
String address = "www.turingscraft.com";
String url = "http://" + variable;
Program demonstrating the same
public class Temp {
public static void main(String[] args) {
String address = "www.turingscraft.com";
String url = "http://" + address;
System.out.println("Prefix: http://");
System.out.println("Address: " + address);
System.out.println("Concatenated String: " + url);
}
}