Tag: programming languages
Questions Related to programming languages
Match the mobile development platforms with programming languages a. Android i. Java b. Blackberry ii.C c. iPhone iii. Java (RIM APIs) d. BREW iv. Objective C
import java.io.*; class Master { String doFileWork() throws FileNotFoundException { return "a"; } } class Slave extends Master { public static void main(String[] args) { String s = null; try { s = new Slave().doFileStuff(); } catch ( Exception x) { s = "b"; } System.out.println(s); } //insert a codeline } Choose the correct answers :
class Demo { public static void main(String[] args) { String s = "- " ; try { doMath(args[0]); s += "t "; // line 6 } finally { System.out.println(s += "f "); } } public static void doMath(String a) { int y = 7 / Integer.parseInt(a); } } At commandline if the input is java Demo What will be output?
class Demo { public static void main(String [] args) { int x = 0; // insert code here do { } while (x++ < y); System.out.println(x); } } Which, inserted at line 4, produces the output 12?