Tuesday, 8 October 2019

Introduction to classes

Introduction to classes

java,class in java,java tutorial,classes in java,java class,class,java (programming language),object class in java,class and object in java,classes and objects in java,learn java,java classes,java programming,pojo class in java,class class in java,what is class in java,class member in java,java (software),abstract class in java,class creation in java,defining a class in java

What is a class

Object and Class are the two basic principles of Object Oriented Programming

They can be considered as the two sides of a coin, which cannot be disintegrated.

Each object belonging to a class, contains entire set of data and functions included in the class.

Understand concept of classes-

A class is a user defined blueprint or prototype from which objects are created.

  It represents the set of properties or methods that are common to all objects of one type.

 In general, class declarations can include these components, in order:

Modifiers : A class can be public or has default access.

Class name: The name should begin with a initial character.

Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.

Interfaces(if any): A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.

Body: The class body surrounded by braces, { }.

Object


Introduction to object 

java,object,java tutorial,object in java,object class in java,what is object in java,class and object in java,class in java,java objects,java (programming language),java classes,java tutorials,classes in java,object oriented programming java,


What are object-
Objects are a unique entity which contain data and function group together.

In Object oriented programming problem is break down to small components called object's.

Understanding objects-
To understand objects in object oriented programming(OOP) let's consider a object from real world.

The object from real world consist following characters-
• It is visible .
• It can be defined and describe.
• It can be brought into action.

Example let's consider camera as a real world object. It has -
• Camera is visible
• Camera are used to click photographs
• We can click photos by clicking a button on camera.
Every object contains a characteristic and behavior let take example of potato

It's characteristic-
• It is brown in colour
• It is oval in shape
It's behavior-
• It is used to make vegetables
• It is also used in making many products like chips.

The objects, which we have discussed above are real world objects

 In fact, a program does not deal with real world object. The program uses software objects.

 Let us relate a real world object with the software object.

• The state or characteristic of real world object are data members in software object.
• In the same way behavior in real world object are considered as the function or method in software object.

You can understand by given below image
java,object,java tutorial,object in java,object class in java,what is object in java,class and object in java,class in java,java objects,java (programming language),java classes,java tutorials,classes in java,object oriented programming java,
Let's consider a class has object car. So by above picture you can understand the characteristics of object(car) are fuel and maxspeed, and its behavior are drive(),refule(),getfule(),setspeed(),etc.

Creation of object in a program-

1) Using new Keyword : Using new keyword is the most basic way to create an object.

 This is the most common way to create an object in java. Almost 99% of objects are created in this way.

 By using this method we can call any constructor we want to call (no argument or parameterized constructors).


2) Using New Instance: 

If we know the name of the class & if it has a public default constructor we can create an object –Class.forName

We can use it to create the Object of a Class. Class.forName actually loads the Class in Java but doesn’t create any Object. 

To Create an Object of the Class you have to use the new Instance Method of the Class.


3) Using clone() method: 
Whenever clone() is called on any object, the JVM actually creates a new object and copies all content of the previous object into it.
 Creating an object using the clone method does not invoke any constructor.
To use clone() method on an object we need to implement Cloneable and define the clone() method in it.

Wednesday, 2 October 2019

Introduction to object oriented programming with java.

object oriented programming,what is object oriented programming,object oriented programming java,object-oriented programming,programming,object oriented,object,object-oriented programming

Procedure oriented approach-
                           The procedure oriented approach allows the user to develop their logic by applying a number of functions that would enable program productivity.

In procedure oriented programming system, many instruction are written to carry out any task.

Theses information is group together to form function. We focus more on function rather than data.

You can clearly understand the concept by below flow diagram.

object oriented programming,what is object oriented programming,object oriented programming java,object-oriented programming,programming,object oriented,object,object-oriented programming

In this system the global data is loosely attached to the function.

They keep floating throughout the program. In order to manke any change in the function you may need to reschedule the associat data value.

 This may affect the normal sequence of the programming logic-

Characteristics of procedure oriented programming.

• Emphasis is more on function rather than data.
• Function share global data.
• Data value can keep floating from one function to another.
• It uses top down approach of programming.

Why there is need for object oriented programming-

1) As data value are globally to all function on procedure oriented programming, so if you want in make change in any data value you may need to make necessary changes in all the function.

2) It is not suitable to solve complex problem in real situation.


Introduction to object oriented programming-

Object oriented approach is to standardize the program by creating partitioned memory data for both data and function.

It has been developed to improve program productivity and also to overcome the traditional approach of programming.

In contrast to these, object oriented programming does not allow data to flow freely from function to function and procedure to procedur.

 In this system, the complete problem is decomposed into a number of entities called object.

 These objects are created and maintained along with a set of related data.

The data are created in such a way that they cannot be chaned or edite from other functios or objects.

The data of an object can be accessed through functions associated with that object.

However, function of an object. can access the function of the other object. You can understand more from give below diagram.

object oriented programming,what is object oriented programming,object oriented programming java,object-oriented programming,programming,object oriented,object,object-oriented programming

Features of object oriented programming-

• It gives stress to data items rather than function.
• It makes complete problem/program easier by dividing it to number of objects.
• The object can be used as bridge to have data flow from function to function.
• You can easily modify the data without changing function.

Basic elements of object oriented programming-

Classes
Object
• Data abstraction
• Polymorphism
• Inheritance
• Dynamic binding
• Encapsulation
• Data hiding


















Sunday, 29 September 2019

Programming languages which are future of coding.

programming language,programming languages,programming,best programming language,top programming languages,programming languages 2019,top programming languages 2019,


Today world is filled with many programming languages. There are many old one's and many new are emerging.

Many old ones get replaced by many new ones . So let take a look at the languages which will be very important in the future of coding.

1.Python3




programming language,programming languages,programming,best programming language,top programming languages,programming languages 2019,top programming languages 2019,
Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readaility with its notable use of significant whitespace. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
Features -
1) Python is easy to learn and use. It is developer-friendly and high level programming language.
2) Python language is more expressive that is it is more readable.
3) Python is an interpreted language.
4) Python can run equally on different platform i.e on linux,windows,mac,android etc.
5) Python language is free and is available at official web site.
6) Python is object oriented and support classes and object's.
7) Python has large and broad library and prvides rich set of modules and function for rapid development of application's.



2.java

programming language,programming languages,programming,best programming language,top programming languages,programming languages 2019,top programming languages 2019,

Java is a general-purpose programming languagethat is class-based, object-oriented (although not a pure object-oriented language, as it contains primitive types and designed to have as few implementation dependencies as possible. It is intended to let application developers write once, run anywhere (WORA),meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.
Features-
1) The Java programming language is easy to learn. Java code is easy to read and write.
2) Java is similar to C/C++ but it removes the drawbacks and complexities of C/C++ like pointers and multiple inheritances.
3) Unlike C++ which is semi object-oriented, Java is a fully object-oriented programming language. It has all OOP features such as abstraction, encapsulation, inheritance and polymorphism.
4) Since Java SE version 8 (JDK 8), Java is updated with functional programming feature like functional interfaces and Lambda Expressions. This increases the flexibility of Java.
5) With automatic garbage collection and simple memory management model (no pointers like C/C++), plus language features like generics, try-with-resources,Java guides programmer toward reliable programming habits for creating highly reliable applications.
7) The Java platform is designed with multithreading capabilities built into the language. That means you can build applications with many concurrent threads of activity, resulting in highly interactive and responsive applications.
6) Java code is compiled into bytecode which is highly optimized by the Java compiler, so that the Java virtual machine (JVM) can execute Java applications at full speed. In addition, compute-intensive code can be re-written in native code and interfaced with Java platform via Java Native Interface (JNI) thus improve the performance.
3.Kotlin

programming language,programming languages,programming,best programming language,top programming languages,programming languages 2019,top programming languages 2019,


Kotlin is a cross-platform, statically typed, general-purpose programming language with type inference. Kotlin is designed to interoperate fully with Java, and the JVM version of its standard library depends on the Java Class Library, but type inference allows its syntax to be more concise. Kotlin mainly targets the JVM, but also compiles to JavaScript or native code(via LLVM). Kotlin is sponsored by JetBrains and Google through the Kotlin Foundation.

Features -

1)  The Kotlin programming language is not only easy to learn, it is also effective in the way that it codes your application. Developers won’t need to spend a lot of time grasping this language.

2)  Extension function suggests, this allows you to add extra features to your existing component, which makes it easy for you to add simple yet impressive features. 

3)   You can run Java codes on Kotlin and vice versa. You just need to add the Java class above to your Kotlin project.

4)  As Kotlin compiles to JVM bytecode or JavaScript, Java and JS developers will be most tempted to learn this programming language. 

5)  The standard Kotlin library doesn’t have garbage, it’s tight and small. It has mostly focused extensions to the Java standard library.


4.Go language

programming language,programming languages,programming,best programming language,top programming languages,programming languages 2019,top programming languages 2019,


Go, also known as Golang, is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is syntactically similar to C, but with memory safety, garbage collection, structural typing,and CSP-style concurrency.

Feature -

1) Go offers some great concurrency primitives and makes it extremely easy to implement a concurrent system. Go supports this at the language level and concurrency is a first class citizen. The fundamental unit for this in Go is a go routine.

2)Go is a relatively simple language and was designed with a very minimalistic approach. I found it easy to pick up and get started with. The standard library contains most things including a web server.

3)Go’s compiler is super fast. It is easily possible to compile a large Go program within a few seconds. The fact that the language syntax is so simple means that compilation is much quicker. The language was designed to be easily parseable without a symbol table.

4)I thought I’d never have to use pointers after my university days, learning C. Go aims to provide a modern equivalent of C in some areas and has brought back pointers. Most modern languages do not provide pointers, however I do feel pointers help solve a lot of common issues and play a far more important role when it comes to memory layout and building low level system tools.

5)Coming from other languages, it may seem like Go is not object-oriented. It does not provide the class keyword and has no support for inheritance. This might seem bizarre. However, Go’s replacement for classes are structs. A struct may have any number of properties and methods defined on them.

5) Ruby

programming language,programming languages,programming,best programming language,top programming languages,programming languages 2019,top programming languages 2019,




Ruby is an interpreted, high-level, general-purposeprogramming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.Ruby is dynamically typed and uses garbage collection. It supports multiple programming paradigms, including procedural, object-oriented, andfunctional programming. According to the creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, Basic, and Lisp.
Features-
1)  Ruby is purely object oriented programming language. Each and every value is an object. Every object has a class and every class has a super class. Every code has their properties and actions. Ruby is influenced with Smalltalk language. Rules applying to objects applies to the entire Ruby.
2)   Ruby is a flexible language as you can easily remove, redefine or add existing parts to it. It allows its users to freely alter its parts as they wish.
3)   Ruby has a feature of single inheritance only. Ruby has classes as well as modules. A module has methods but no instances. Instead, a module can be mixed into a class, which adds the method of that module to the class. 
4)   Ruby generally prefers English keyword and some punctuation is used to decorate Ruby. It doesn't need variable declaration.
5)  Ruby is a dynamic programming language. Ruby programs are not compiled. All class, module and method definition are built by the code when it run.