Although polymorphism is a widely useful phenomena in C++ yet it can be quite complicated at times. For instance consider the following code snippet: CPP… Read More
Predict the output of the following program. class Test implements Cloneable { int a; Test cloning() { try { return (Test) super.clone(); } catch(CloneNotSupportedException… Read More
Predict the output of the following program. class Test { public static void main(String[] args) { String obj1 = new String("geeks"); String obj2 =… Read More
Predict the output of the following program. class Test { int a = 1; int b = 2; Test func(Test obj) { Test obj3… Read More
Predict the output of the following program. class Test { int a = 1; int b = 2; Test func(Test obj) { Test obj3… Read More
Predict the output of the following program. Java class Test { boolean[] array = new boolean[3]; int count = 0; void set(boolean[] arr, int… Read More
In Java, ‘this’ is a reference variable that refers to the current object, or can be said “this” in Java is a keyword that refers… Read More
Given a number n, print all primes smaller than or equal to n. Examples: Input: n = 10 Output: 2, 3, 5, 7 Input: n… Read More
Machine learning is one of the most exciting technologies that one would have ever come across. As is evident from the name, it gives the computer… Read More
To begin Web development you may go through this article first. Grid System Buttons, Glyphicons, Tables Vertical Forms, Horizontal Forms, Inline Forms DropDowns and Responsive Tabs… Read More
Introduction Random numbers in computer science is used for cryptography, simulation, sampling, design and games. In the past the need for more and more randomness… Read More
Predict the output of the following program. class First { void display() { System.out.println("Inside First"); } } class Second extends First {… Read More
Predict the output of the following program. abstract class demo { public int a; demo() { a = 10; } abstract public void set();… Read More
Predict the output of the following program. class Test { public static void main(String[] args) { StringBuffer a = new StringBuffer("geeks"); StringBuffer b = new… Read More
Predict the output of the following program. class Test { public void demo(String str) { String[] arr = str.split(";"); for (String s : arr) {… Read More