Showing posts from May, 2015

Method and Variable shadowing in Java

Method Shadowing In java only instance method of parent class can be overridden, not static methods. Below example shows method shadowing in java. class Parent { private static String hideMe = "HIDDEN-GEM-PARENT" ; public sta…

Inheritance in python

In object-oriented programming, a modular and hierarchical organization of classes and software module is achieved using   inheritance.  The classes at top in hierarchy is typically described as the base class, parent class, or superclass, while clas…

Print Even and Odd number using two different thread

One of the basic question asked in Java interview to check basic understanding of inter thread communication and related threading construct. In this post we are using synchronisation block and wait()/notify() to print even/odd numbers by two differe…

Python questions and answers - Part 1

1. What is floor division in python ?  OR What is difference between operator / and // ? Answer:  Operator // is called floor division in python.Integer division was a concern for  python developer prior to python 2.2. Python 2.2 came up with new …

Load More
That is All