Object Oriented Programming with Java
Lab Exercise
Lab Unit – 1 (2 Hrs Real Time)
1.1 Write a program to display any message:
1.2 Write a Java program to display default value of all primitive data types of
Java.
1.3 Write a program check two strings are equal or not.
Lab Unit – 2 (2 Hrs Real Time)
2.1 Write a program to give the examples of operators.
2.1.1 Increment and decrement operators.
2.1.2 Bitwise Complement Operator.
2.1.3 Arithmetic operator.
2.1.4 Relational Operator
2.1.5 Bitwise operator.
2.1.6 Conditional Operator.
2.2 Write a program to give the example of control statements.
2.2.1 If statements.
2.2.2 Switch Statements.
2.2.3 For loop.
2.2.4 While Statements.
2.2.5 Do statements
2.3 Write a program to calculate the following
2.3.1 Find the length of array.
2.3.2 Demonstrate a one-dimensional array.
2.3.3 Demonstrate a two-dimensional array.
2.3.4 Demonstrate a multi-dimensional array.
2.4 Write a program give example for command line arguments.
Centre for Information Technology and Engineering, Manonmaniam Sundaranar University
1
Object Oriented Programming with Java
2.4.1
To find the sum of command line arguments and count the invalid integers entered.
2.4.2
To get the name using command line.
2.5 Write a program to print the following triangle of binary digits.
2.5.1
1
101
10001
1000001
100000001
2.5.3
2.5.2
5
45
345
2345
12345
012345
1
12
123
1234
12345
2.6. Write a program to the find the following
2.6.1 Prime number checking
2.6.2 Sum of digit
2.7 Write a program to arrange the numbers in ascending order.
2.8 Write a program to calculate the roots of Quadratic equations.
2.9 Write a program for calculating Matrix Operations.
2.9.1 Addition.
2.9.2 Multiplication.
Lab Unit – 3 (2 Hrs Real Time)
3.1 Write a program to create a room class, the attributes of this class is roomno, roomtype, roomarea and ACmachine. In this class the member