Tuesday, August 25, 2009

Data Hiding

If a subclass is having a data member with same name as superclass data member then inside subclass, subclass data member hides superclass data member.
class Sample{
 int a = 5;
}
class SubSample extends Sample{
 int a = 6;
 void display(){
  System.out.println("\n a="+a);
 }
}
class InheritanaceDemo14{
 public static void main(String[] args){
   SubSample s = new SubSample();
   s.display();
   System.out.println("\n s.a="+s.a);
 }
}
output:
a = 6
s.a = 6

A super class object can refer its subclass object

class Sample{
}
class SubSample extends Sample{
}
class InheritanaceDemo8{
 public static void main(String[] args){
  Sample s1 = new Sample();
  Sample s2 = new SubSample();
  System.out.println("s1 = " + s1);
  System.out.println("s2 = " + s2);
 }
}
output:
s1 = Sample@010b30a7
s2 = SubSample@1a758cb

Saturday, August 15, 2009

Using Smart Phones to Access Site Specific Services - a Mini Project

This is a mini project which has both code and documentation available.
This work investigates how smart phones can augment site specific services that are electronic services or application that resides in a specific location. Service provider runs MST server on Bluetooth enable PC’s or mobiles located in the store, restaurant, cinema and access them via their mobile service explores (MSE) enable smart phones. The service could push dynamic information updates to the phone via TEXT and MMS. This is to develop a push-based location aware advertising system using Bluetooth. This lets users receive advertisements on their smart phones based on their proximity to particular shops. At a minimum, we need is a single Bluetooth enabled PC to advertise a range of products.
Download Docmentation & code here