Programming Languages: Java, PHP & Algorithms
Test your knowledge of programming language fundamentals including Java OOP concepts, PHP basics, type systems, and algorithm complexity analysis.
Questions
Who is the loose character in java??
- class
- interface
- package
- data type
JAVA 1.4 introduced the concept of Generics?
- True
- False
PHP is a client- side scripting language?
- True
- False
PHP stands for?
- Pre Hypertext Processor
- Preprocessor Hypertext
- Hypertext Preprocessor
- Processor Hypertext Pre
PHP is a loosely typed language?
- True
- False
Which are two statements for outputing the text in PHP?
- print and display
- display and echo
- println and display
- echo and print
Following code will result in: int a = 3.5;
- Compilation error
- Runtime error
- a being 3.5
- a being 3
Following code will result in: int a1 = 5; double a2 = (float)a1;
- Compilation error
- Runtime error
- Runtime exception
- No error
Following code will result in: int a = 9/0;
- Compilation error: Divisions must be in a try block.
- Compilation error: DivideByZeroException
- Runtime Exception - correct answer
- No Error: a is NaN
Following code will result in: float a = 9/0;
- Compilation error: Divisions must be in a try block
- Compilation error: DivideByZeroException
- Runtime Exception
- No Error: a is NaN
Following code will result in: class A { int b = 1; public static void main(String [] args) { System.out.println("b is " + b); }}
- Compilation error
- Runtime Error
- Runtime Exception
- Output of b is 1
Following code will result in: class A { public static void main(String [] args) {B b = new A(); }} class B extends A {}
- Compile error
- Runtime Exception
- No error
- Rintime Error
Following code will result in: class A { public static void main(String [] args) {A a = new B(); }} class B extends A {}
- Compiler error
- Runtime Exception
- No errors
- Runtime Error
If class A implements an interface does it need to implement all methods of that interface?
- Yes, always it should implement
- No, Never
- No, Not when A is abstract
- None of the above
The methods wait(), notify() and notifyAll() in Object need to be called from synchronized pieces of code.
- true
- false
- Depends on situation
- none of the above
A class cannot be declared
- volatile
- private
- default
- static
mainn() { main(); } This loop runs upto???
- Infinite loop
- Until Stack Underflow
- Until Machine Hangs
- Stack Overflow
Complexity of Quick Sort????(avg)
- O(n2)
- O(log n)
- O(nlogn)
- O(n2 logn)
Complexity Of Bubble Sort..???
- O(n)
- O(log n)
- O(n^2)
- O(n log n)
What is the difference between the types double and Double?
- double is primitive datatypes. Double is a class
- Both are primitive dataType
- Both are class type
- double is class and Double is primitive Type