Skip to main content

Posts

Showing posts from May, 2016

Base of Java

Base of Java    Encapsulation , Inheritance , Polymorphism OOPs : An Introduction One of the most fundamental concept of  OOPs  is  Abstraction . Abstraction is a powerful methodology to manage complex systems. Abstraction is managed by well-defined objects and their hierarchical classification. For example a car in itself is a well-defined object, which is composed of several other smaller objects like a gearing system, steering mechanism, engine, which are again have their own subsystems. But for humans car is a one single object, which can be managed by the help of its subsystems, even if their inner details are unknown. Java is an object oriented language because it provides the features to implement an object oriented model. These features includes  encapsulation ,  inheritance  and  polymorphism . OOPS  is about developing an application around its data, i.e. objects which provides the access to their properties a...

Double to string conversion in Java

Double to String conversion Two ways to convert double to String: 1: Using valueOf() method public static String valueOf(double d) We can convert the double primitive to String by calling valueOf() method of String class. This method returns the string representation of the double argument. double var = 22.22 ; String strg = String . valueOf ( var ); 2: Using toString() method public String toString( ) : This is the another method that can be used to convert double to String. This method returns a string representation of the Double object. The primitive double value represented by this object is converted to a string. double var = 33.33 ; String str = Double . toString ( var ); Example: public class DoubleToString {    public static void main ( String [] args ) {                 // Method 1: using valueOf() method of String class         ...

JAVA BASICS (OOPs Concepts)

OOPs Basics Java is known as an Object Oriented language. So,  what does Object Oriented mean ? It means that the  foundations  of any kind of  program constructed in Java  might be imagined in terms of  Objects . Note  : Above are the links of separate detailed tutorials on each topic. However if you want to brush up the things for interview, below is a brief of each of the above topic which will help you re-call the things. a) Data b) Instructions for processing that data into a self-sufficient ‘object’ that can be used within a program or in other programs. Advantage of Object Oriented Programming a) Objects are modeled on real world entities. b) This enables modeling complex systems of real world into manageable software solutions. Programming techniques a)  Unstructured Programming  (Assembly language programming) b)  Procedural Programming  (Assembly language, C programming) c)  Object Orien...