programming languages Online Quiz - 168
Description: programming languages Online Quiz - 168 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
A friend of mine once wrote a function as follows. int * func() { int i; for (int k=0;k<200;k++) //Do something here .... return &i; } I think it is faulty . What is wrong here?
I want to declare a pointer to a constant int variable ,pointing to a constant memory location. What is the syntax?
consider the following line in the c++ code extern "C" { f1(); f2();... } The purpose of the extern keyword is
public static void main(String[] args){ Integer i = new Integer(5); List myList; myList = new ArrayList(); myList.add(3); myList.add(5); myList.add(7); myList.remove(i); for(String s: myList) { System.out.println("List Value >> "+s); } } What is the output?
class A{ public void _a(){ System.out.println("A"); } } class B extends A{ public void _a(){ System.out.println("B"); } } public class InheritanceTest { public static void main(String[] args){ A aa = new B(); System.out.println(aa._a()); } } What is the output?
public class SwitchTest { public static void main(String[] args) { Boolean b = Boolean.TRUE; switch(b) { case(true): System.out.println("A"); case(false): System.out.println("B"); case(3): System.out.println("C"); } } } output?
Constants cannot be marked with which of the below keywords