Topics
Revision of Class IX Syllabus
Introduction to Object Oriented Programming Concepts
- Introduction of Object-oriented Programming
- Procedure Oriented Language
- Object Oriented Language
- Principles of Object Oriented Programming (OOP)
Library Classes
Elementary Concept of Objects and Classes
- Introduction of Elementary Concept of Objects and Classes
- Creating an Object of a Class
- Real World Vs Software Class and Objects
- Features of a Class
- Class and Attributes
Arrays (Single Dimensional and Double Dimensional)
Values and Data Types
- Introduction of Values and Data Types
- Character Sets in Java
- Encoding of Characters
- Escape Sequences
- Tokens
- Data Types
- Type Conversion
String Handling
- Concept of String Class
- String Functions
- StringBuffer Functions
- Differences between String and StringBuffer objects
Operators in Java
- Introduction of Operators in Java
- Expression and Statement
- Types of Operators
- Arithmetical Operators
- Relational Operators
- Logical Operators
User - Defined Methods
- Introduction of User - Defined Method
- Construct or Components of a Method
- Features of the Return Statement
- Invoking a Method
- Different ways of defining a method
- Ways of passing values to a function
- Side Effects of Call by Reference
- Function Overloading
- Recursive Function
Introduction to Java
- Introduction to Java
- Java Compiler and Interpreter
- Basic Elements of Java Programming
- Output Statement in Java Programming
- Java Programming using BlueJ
- Java Program on BlueJ Platform
Input in Java
- Introduction of Input in Java
- Using Function Argument
- Using Stream Class
- Using Scanner Class
- Using Command Line Argument
- Types of Errors
- Comment Statements in Java Programming
Class as the Basis of All Computation (Objects and Classes)
- Introduction to Object Oriented Programming (OOP)
- Objects
- Class
- Access Specifiers
- Instance Variables
- Class variables (Static variables)
- Local variables
- Different Types of Methods
- This Keyword
Mathematical Library Methods
- Introduction of Mathematical Library Methods
- Methods of Math Class
- Trigonometrical Functions
Constructors
Conditional Statements in Java
- Introduction of Conditional Statements in Java
- Normal Flow of Control
- Conditional Flow of Control
- If constructs
- Multi-Branching statement
Encapsulation and Inheritance
Iterative Constructs in Java
- Introduction of Iterative Constructs in Java
- Entry Controlled Loop
- Exit Controlled Loop
- Some important terms used with loops
Nested Loop
- Introduction of Nested Loop
- Types of Nested Loops
- Break Statement in a Nested Loop
String Class:
Java Class Library (JCL) contains a class called string, which is available under the java.lang package. It allows the user to create an object or declare a variable to store a set of characters. Hence, a set of characters within double quotes is known as a String.
String Variable
String variable is a named memory location that contains a string constant or string literal. The value of variable may change in the program. A variable declared with data type String gains the capability of storing a set of characters.
Assigning a string
A string can be assigned in two different ways, as follows:
1) Direct Assignment: In this method, a string constant is directly assigned to a string variable. Syntax: <String data type> <Variable> = <String Literal>
2) Assignment by using new Keyword: It allows the user to assign a string object with a string literal or variable by using new keyword with the help of a constructor. Syntax: <class name> <object name> = new <constructor> <String literal/variable>;
By default, String data type creates a character array to store a set of characters in different cells. Thus, assigning a string means assigning a character array to a String object.
Related QuestionsVIEW ALL [5]
Design a class Railway Ticket with following description:
Instance variables/data members:
String name: To store the name of the customer
String coach: To store the type of coach customer wants to travel
long mob no: To store customer’s mobile number
int amt: To store a basic amount of ticket
int total amt: To store the amount to be paid after updating the original amount
Member methods
void accept (): To take input for a name, coach, mobile number and amount
void update (): To update the amount as per the coach selected
(extra amount to be added in the amount as follows)
| Type of Coaches | Amount |
| First_ AC | 700 |
| Second_AC | 500 |
| Third _AC | 250 |
| sleeper | None |
void display(): To display all details of a customer such as a name, coach, total amount and mobile number.
Write a main method to create an object of the class and call the above member methods.
Design a class name ShowRoom with the following description :
Instance variables/ Data members :
String name – To store the name of the customer
long mobno – To store the mobile number of the customer
double cost – To store the cost of the items purchased
double dis – To store the discount amount
double amount – To store the amount to be paid after discount
Member methods: –
ShowRoom() – default constructor to initialize data members
void input() – To input customer name, mobile number, cost
void calculate() – To calculate discount on the cost of purchased items, based on following criteria
| Cost | Discount (in percentage) |
| Less than or equal to ₹ 10000 | 5% |
| More than ₹ 10000 and less than or equal to ₹ 20000 | 10% |
| More than ₹ 20000 and less than or equal to ₹ 35000 | 15% |
| More than ₹ 35000 | 20% |
void display() – To display customer name, mobile number, amount to be paid after discount
Write a main method to create an object of the class and call the above member methods.
