Tag: technology
Questions Related to technology
var one = ["a", "b"];
var two = ["c", "d"];
var three = one.concat(two); alert(three);
var one = ["a", "b"];
alert(one.join("&&"));
var one = ["a", "b", "c"];
one.pop();
alert(one);
What is the output of the below JavaScript?
var one = ["a", "b", "c", "d"];
alert(one.slice(-2));
Given:
public static void before() {
Set set = new TreeSet();
set.add("2");
set.add(3);
set.add("1");
Iterator it = set.iterator();
while (it.hasNext()) System.out.print(it.next() + " ");
}
Which statements are true?
Given:
import java.util.*;
public class Magellan {
public static void main(String[] args) {
TreeMap myMap = new TreeMap();
myMap.put("a", "apple"); myMap.put("d", "date");
myMap.put("f", "fig"); myMap.put("p", "pear");
System.out.println("1st after mango: " + // sop 1
myMap.higherKey("f"));
System.out.println("1st after mango: " + // sop 2
myMap.ceilingKey("f"));
System.out.println("1st after mango: " + // sop 3
myMap.floorKey("f"));
SortedMap sub = new TreeMap();
sub = myMap.tailMap("f");
System.out.println("1st after mango: " + // sop 4
sub.firstKey());
}
}
Which of the System.out.println statements will produce the output 1st after mango: p?
Given:
import java.util.regex.*;
public class Archie {
public static void main(String[] args) {
Pattern p = Pattern.compile(args[0]);
Matcher m = p.matcher(args[1]);
int count =
while(m.find())
count++;
System.out.print(count);
}
}
And given the command line invocation:
java Archie "\d+" ab2c4d67
What is the result?
Whats ICONV?