Skip to main content

JAVA CLASS at a glance..


Hi, in this blog let’s get started with java…. let’s skip its history and move to its concepts. Ultimate aim to develop java is to behave as a pure Object-Oriented language but unfortunately it is not. Because its supports primitive data types like int, float, etc., to overcome this JAVA has introduced wrapper class. I’ll tell u detail soon after.
The main building blogs of java program is Objects and Class with the help of these we can simulate any real-time object with its qualities as a JAVA program. In this blog I share my knowledge about the class.
Class, the class is a blue print or framework which contains variables and methods(functions) that define the quality of an object. The syntax of class is “class <name> {……….}”. for example

class box {                        //……………………………………………class name
int length = 10;
int breadth = 10;
String colour =” blue”;
String shape = “square”;
void print() {                       //………………………………………….method.
System.out.println(“This box is in “ +shape+” with “+blue” colour);
            }
}

    The class has different types assigned with a specific purpose or a feature. Singleton class, which has only one object it is achieved by making a constructor as a static one. Concrete class, the class has all definition these class has same syntax as a normal class. Wrapper class, in order to make java as a pure object-oriented language this class are introduced which contains logics that replace the primitive data types for example int a=10 also written as Integer a =new Integer (10), Integer is a wrapper class of int . The classes which introduced at beginning of java are called as legacy class and it is advised not to use due to lack of support.
     There is a special class called Abstract class, which has a syntax” abstract class <name>{……..}”. we will talk about this in detail later.
In this blog I had mentioned some terms like constructor, abstract, static object which will be covered in my next topic. If you want to know java history go-to wiki...

For more blogs subscribe and comment your valuable comments below..... 

               Follow me @ facebook

Comments

Popular posts from this blog

Failed even in Love..........

Hi, Once again sorry for my long gap. I actually had no idea about what to blog. Guys from now I'll post minimum one blog per week. thank you for all who asked me to continue my blog they are my motivators. So, I wish this could be a inspirational blog. Do you failed in anything and hidden those failure ?, I like to start my blog with this question. Mostly I hope the from you is yes. Because we are living in culture where the failed peoples are looked in awkward manner.  Actually all people has failed in something. But I am not writing this blog to talk about failures but about way you handle it. Myself, As a friend I like to share my views on my failure. I faced many failure I failed when learn something new. I never succeeded in any new skills at the very first attempt even in my love but not in my exam's. Nothing in the world is born with skills. They develop their skills after the birth. Even the new born of fish learns to swim after few seconds. What made it to acquire it

X-O game using JAVA

Here, you can find a basic java code to implement X-O game. Follow me @ facebook //*********************************Coded-By : SOMES KUMAR K.*******************************//   //*********************************LEARN CODE WITH FUN*************************************//     import java.util.Scanner; public class X_O_Game { int xi , xj ; static Scanner s = new Scanner(System. in ); char board [][]; public void make_board( int n){ if (n% 2 != 0 ){ setBoard(n); } else { System. out .println( "Enter valid Board Size" ); n = s .nextInt(); make_board(n); } } public void setBoard( int size) { board = new char [size][size]; for ( int i= 0 ;i<size;i++){ for ( int j= 0 ;j<size;j++){ board [i][j]= ' ' ; } } } boolean check_board_empty( int size){ boolean c= true ;

OOP Encapsulation with Modifiers..

                  In this blog we can know about why we go for JAVA?. Java is a language known for object oriented features and its network support. Here object oriented is achieved by three concepts Encapsulation Inheritance Polymorphism                 but Java is not pure object oriented  because of its support to primitive data types(explained later..) like int, float,...to overcome this JAVA has loaded with wrapper class( know more ).          Encapsulation,   we had come across the word "capsule" many times in our life. capsule is nothing but a outer protection(cover) used to protect the something from external factors. example the medicines usually come with a capsule to protect the chemicals inside it. Similarly the encapsulation is used to wrap the code or data from intruders in order to ensure its security. It can be achieved from modifiers. Java has many modifiers each with unique characteristic features but for encapsulation we commonly g

My First Blog !

Hi, this is my first blog, I had planned to write a blog on every week from this year first of all, I wish you a very happy new year 2017 let 16 have some sorrow’s, joy’s, up’s and down’s On this new try to recollect it all and figure the reason for it Today's blog I'll say some interesting facts about Jan 01, The Romans celebrated the 1 st new year at Jan 1 on 153 b c, January is derived from Janus who is god for Gateways and beginnings, Jan 01 is accepted as a 1st day of the year in Julian and Gregorian calendar's but most of calendar’s  have different different days Tamil people celebrate their New at Chithirai 01 (April 14-15), when the Sun enter in to the zodiac Aries Chinese celebrate their new year when Lunar(moon) calendar so they have new year between (Jan 20 - Feb 20) Thailand celebrates its new year at april-13 or april-14, where it called as Songkran where the people splash water on other That’s all about today thank you for reading it......

Arrays using Pointers..

In this blog let’s try to understand about pointer.   So, what is pointer?... pointer is thing that used to point something in a group. For example, Here, the pointer is used to point the temperature in the gauge. Similarly, in computer the data gets stored in memory and each data is assigned with an address in the memory. So, the pointer is used to point the data, in other words pointer contains a memory address of that particular data. (int a = 10; here the ‘a’ indirectly act as a pointer which has the value ‘10’.) Now we can see that how arrays are similar with pointer. We know that array is a continuous block of memory that stores multiple data of same kind. Let’s have a close look In c program pointer a declared with ’*’   symbol followed by a variable (eg : int *ptr). int a[10];---------------------------( 1 )------------------> this array stores 10 integers at max, here all elements in array is referenced with the variable ‘a’. which is more less equ

Intro to Virtualization...

Virtualization is used to extend my usage to next level, for example any pc could run only a single operating system at a time, so whatever may be its configuration, here comes the problem the physical resources is underutilized, here the physical resources include storage, ram, processor, etc. If its that’s not matters a lot, but when it comes to distributed system and servers it matters much more than we think, imagine you are planning to host a website in a host server, the host can have only a single IP (Internet Protocol) and in that only one DNS can be attached, and the host’s memory, processor and storage cannot be shared, which leads to increase its cost. For example, GODADY has 10K clients, to host them if it needs 10k host machines(computer). Can you imagine the cost for maintenance and its power consumption? OMG! Its very high. So here comes Virtualization which allows you to run multiple operating systems with unique IP and properties by creating multiple VM (Virtual Mach