Tag: programming languages
Questions Related to programming languages
void main() { int i = 10; long *p=&i; p++; printf("%d",abs(&i-p)); }
void main(){ char far *p = 0x417; *p=64; }
void main() { int a[2][3]={{1,2,3},{4,5,6}}; printf("%d\n",++**(a+1)); }
ejbCreate() method of CMP bean returns
Which of the following statements hold true in the following program? package generics; import java.util.ArrayList; import java.util.List; public class Ques04 { public static void main(String[] args) { List extends Instrument> allInstruments = new ArrayList(); // -->X allInstruments.add(new Guitar()); allInstruments.add(new Violin()); } } interface Instrument { public void play(); } class Guitar implements Instrument { public void play(){ System.out.println("Playing Guitar."); } } class Violin implements Instrument { public void play(){ System.out.println("Playing Violin."); } }
what is the output of compiling an running the following code? import java.util.*; class CheckTest { public static void main(String [] args) { Hashtable ht = new Hashtable(); ht.put("chec", "check"); ht.put(1000, "check"); // line 1 ht.put("check", 20.01); // line 2 System.out.print(ht.get("chec") + " "); System.out.print(ht.get(1000) + " "); //line 3 System.out.print(ht.get("check")); //line 4 } }
A JSP page is opened in a particular Session. A button is present in that JSP page onclick of which a new Window gets opened.
In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?
What is the output for the following lines of code? import java.io.*; public class FileHandling { public static void main (String[] arg) throws Exception { File f = new File ("ll.txt"); FileOutputStream s = new FileOutputStream(f); PrintStream p = new PrintStream (s); p.println("hi"); } }