Class 9 ICSE - Java

Class 9th Java aims to empower students by enabling them to build their own applications introducing some effective tools to enable them to enhance their knowledge, broaden horizons, foster creativity, improve the quality of work and increase efficiency.
It also develops logical and analytical thinking so that they can easily solve interactive programs. Students learn fundamental concepts of computing using object oriented approach in one computer language with a clear idea of ethical issues involved in the field of computing
Class 9th java topics includes revision of class 9th, constructors, user-defined methods, objects and classes, library classes , etc.

Classes & Objects



What is Class ?



  • Class is a collection of objects and it is the logical construct and it does not take any space in the memory.

  • A Java class uses variables to define the data fields and methods to define the actions.

  • Class is also known as blueprint of prototype of an object

  • Classes are divided in two categories :
    • Pre-defined Classes : Pre-defined classes are those classes that already exists in Java, such as Scanner, System, String etc
    • User-defined Classes : User-defined classes are created by you the programmer / user. These classes take on names that you assign to them and perform tasks that you create . Such as Dog , Test, Demo etc


Syntax :


From the above syntax we can say that "Class is a collection of data and methods."

Example : If we have to build a building then we require a structure por blueprint to build it. So this building is an object and that blueprint is a class.
So to define object what object knows and what object does we use class.


Object of a class



  • An object represents an physical entity that exists in the real world. It is also known as instance of a class.

  • An object has a state, behaviour and identity. Such as book, pencil, student etc.

  • The state of an object is also known as its properties or attributes.
    Example : A rectangle object has the data fields "width" and "height" that characterises a rectangle.

  • The behaviour of an object is also known as its actions. To invoke an object you have to ask object to perform the action.
    str.charAt(2) So here we are calling the method and telling the object to give us the character at index 2.

    Example : A method for circle object :

    getArea() : Returns area of the circle.
    getPerimeter() : Returns the perimeter of the circle.
    setRadius() : set and changes the radius of the circle.


Let us understand through an example how to create class and object in our code :

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com