Friday, October 30, 2015

Latest Mobile Technology link:-

http://developermarch.com/mds/

Tuesday, October 30, 2012

Java advanced concept interview question


Android  & java Interview question & answer for experienced:

I thanks to Mr.Vinay  (Happiest mind Technology Bangalore.) to create awareness for knowing the following subject in java.


Types of classes in java:


  1. top level classes: not nested, but possibly sharing a *.java file.
  2. nested classes: like Russian dolls (either static or inner).
  3. static classes: no associated outer class instance.
  4. inner classes: with an associated outer class instance.
  5. anonymous classes: unnamed inner class defined in the middle of a method (where static init blocks and instance init blocks count as methods).
  6. local classes: named inner class defined in the middle of a method. (where static init blocks and instance init blocks count as methods). Just to keep you on your toes, some programmers us the term local class to include anonymous class.
Thanks to Mr.Joe for following question  & answer: 


Association

Association is a relationship between two objects. In other words, association defines the multiplicity between objects. You may be aware of one-to-one, one-to-many, many-to-one, many-to-many all these words define an association between objects. Aggregation is a special form of association. Composition is a special form of aggregation.
Example: A Student and a Faculty are having an association.



Aggregation

Aggregation is a special case of association. A directional association between objects. When an object ‘has-a’ another object, then you have got an aggregation between them. Direction between them specified which object contains the other object. Aggregation is also called a “Has-a” relationship.

Composition

Composition is a special case of aggregation. In a more specific manner, a restricted aggregation is called composition. When an object contains the other object, if the contained object cannot exist without the existence of container object, then it is called composition.
Example: A class contains students. A student cannot exist without a class. There exists composition between class and students.


Abstraction

Abstraction is specifying the framework and hiding the implementation level information. Concreteness will be built on top of the abstraction. It gives you a blueprint to follow to while implementing the details. Abstraction reduces the complexity by hiding low level details.
Example: A wire frame model of a car.

Generalization

Generalization uses a “is-a” relationship from a specialization to the generalization class. Common structure and behaviour are used from the specializtion to the generalized class. At a very broader level you can understand this as inheritance. Why I take the term inheritance is, you can relate this term very well. Generalization is also called a “Is-a” relationship.
Example: Consider there exists a class named Person. A student is a person. A faculty is a person. Therefore here the relationship between student and person, similarly faculty and person is generalization.

Realization

Realization is a relationship between the blueprint class and the object containing its respective implementation level details. This object is said to realize the blueprint class. In other words, you can understand this as the relationship between the interface and the implementing class.
Example: A particular model of a car ‘GTB Fiorano’ that implements the blueprint of a car realizes the abstraction.

Dependency

Change in structure or behaviour of a class affects the other related class, then there is a dependency between those two classes. It need not be the same vice-versa. When one class contains the other class it this happens.
Example: Relationship between shape and circle is dependency.


Shallow Copy

Generally clone method of an object, creates a new instance of the same class and copies all the fields to the new instance and returns it. This is nothing but shallow copy. Object class provides a clone method and provides support for the shallow copy. It returns ‘Object’ as type and you need to explicitly cast back to your original object.
Since the Object class has the clone method (protected) you cannot use it in all your classes. The class which you want to be cloned should implement clone method andoverwrite it. It should provide its own meaning for copy or to the least it should invoke the super.clone(). Also you have to implement Cloneable marker interface or else you will get CloneNotSupportedException. When you invoke the super.clone() then you are dependent on the Object class’s implementation and what you get is a shallow copy.

Deep Copy

When you need a deep copy then you need to implement it yourself. When the copied object contains some other object its references are copied recursively in deep copy. When you implement deep copy be careful as you might fall for cyclic dependencies. If you don’t want to implement deep copy yourselves then you can go for serialization. It does implements deep copy implicitly and gracefully handling cyclic dependencies.
One more disadvantage with this clone system is that, most of the interface / abstract class writers in java forget to put a public clone method. For example you can take List. So when you want to clone their implementations you have to ignore the abstract type and use actual implementations like ArrayList by name. This completely removes the advantage and goodness of abstractness.
When implementing a singleton pattern, if its superclass implements a public clone() method, to prevent your subclass from using this class’s clone() method to obtain a copy overwrite it and throw an exception of type  CloneNotSupportedException.
Note that clone is not for instantiation and initialization. It should not be synonymously used as creating a new object. Because the constructor of the cloned objects may never get invoked in the process. It is about copying the object in discussion and not creating new. It completely depends on the clone implementation. One more disadvantage (what to do there are so many), clone prevents the use of final fields. We have to find roundabout ways to copy the final fields into the copied object.
Clone is an agreement between you, compiler and implementer. If you are confident that you all three have good knowledge of java, then go ahead and use clone. If you have a slightest of doubt better copy the object manually.

Why  abstract class  is faster than  interface?

 difference between abstract class and interface in Java is that abstract class are slightly faster than interface because interface involves a search before calling any overridden method in Java. This is not a significant difference in most of cases but if you are writing a time critical application than you may not want to leave any stone unturned.

How to create different types of objects?

Using `new` keyword:

By Using Factory Method:

 By Using Cloning Concept:

Using `Class.forName():

Using object deserialization:






Sunday, May 6, 2012

Jobs

We provide Expert Developers @5$/Hr. High Quality. Affordable Prices. 800+ Clients.Free Quote! 
Hire Experts on weekly/monthly, part time/full time or contractual basis. SAVE upto 70% on overall development costs. SKYPE doi.livehelp http://www.expertfromindia.com

Thursday, March 22, 2012

Email Writing Tips


Example 1: Formal
Hello,
I read on your web site that you offer Music CD copying for large quantities of CDs. I'd like to inquire about the procedures involved in these services. Are the files transferred online, or are the titles sent by CD to you by standard mail? How long does it usually take to produce approximately 500 copies? Are there any discounts on such a large quantity?
Thank you for taking the time to answer my questions. I look forward to your response.
Jack Finley
Sales Manager, Young Talent Inc.
(709) 567 - 3498
Example 2: Informal
At 16.22 01/07/2002 +0000, you wrote:
> I hear you're working on the Smith account. If you need any information don't hesitate to get in > contact with me.
Hi Tom,
Listen, we've been working on the Smith account and I was wondering if you could give me a hand? I need some inside information on recent developments over there. Do you think you could pass on any information you might have?
Thanks
Peter
Peter Thompsen
Account Manager, Tri-State Accounting
(698) 345 - 7843

Important Points to Remember

  • Email is much less formal than a written letter. Emails are usually short and concise.
  • If you are writing to someone you don't know, a simple "Hello" is adequate. Using a salutation such as "Dear Mr Smith," is too formal.
  • When writing to someone you know well, feel free to write as if you are speaking to the person.
  • Use abbreviated verb forms (He's, We're, He'd, etc.)
  • Include a telephone number to the signature of the email. This will give the recipient the chance to telephone if necessary.
  • It is not necessary to include your email address as the recipient can just reply to the email.
  • When replying eliminate all the information that is not necessary. Only leave the sections of text that are related to your reply. This will save your reader time when reading your email.

Monday, March 19, 2012

What is Android?


What is Android?

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

Features

  • Application framework enabling reuse and replacement of components
  • Dalvik virtual machine optimized for mobile devices
  • Integrated browser based on the open source WebKit engine
  • Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
  • SQLite for structured data storage
  • Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
  • GSM Telephony (hardware dependent)
  • Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
  • Camera, GPS, compass, and accelerometer (hardware dependent)
  • Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE