Skip to main content

Posts

Showing posts from January, 2018

Class , Constructors and this keyword in Java

#Topic-8 Previous topic (7) we have discussed about How to convert String into primitive data types and primitive data types into String. If you have not gone through that topic, click this link   How to convert String into primitive data types and primitive data types into String.   In this section we will discuss about Class , Constructors and this keyword in Java. Class: Class is a container we can store ‘n’ no of information or details within a class. That details/information must be specified in class name. Class is a collection of Data and Methods, that data and methods we can accessed based on class object or instance. 1)   Constructors in Java Constructor is a special type of method that is used to initialize the object.java constructor is invoked at the time of object creation. It construct the values (i.e. provides data for the object) that is why it is known as constructor. ·   Rules: i)     Constructor...