0% found this document useful (0 votes)
30 views1 page

Assignment No.2: Subject Teacher (Prof. M.B. Patil)

The document outlines an assignment on Java programming concepts and exercises. It includes defining classes and objects, method overloading, differences between vectors and arrays, String class methods like substring(), concatenate(), replace(), wrapper classes and Integer wrapper class methods, String class methods like length(), equals(), charAt(), compareTo(), constructors and constructor overloading, vector class methods like elementAt(), removeElement(), insertElementAt(), addElement(), visibility controls, use of "this" keyword, static fields and methods, garbage collection and finalize() method, array syntax and types, Object class and methods, difference between == and equals(), wrapper classes, and programming exercises on defining classes for students and employees, accepting user input into a vector and deleting/

Uploaded by

Vaibhav Bhagwat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
30 views1 page

Assignment No.2: Subject Teacher (Prof. M.B. Patil)

The document outlines an assignment on Java programming concepts and exercises. It includes defining classes and objects, method overloading, differences between vectors and arrays, String class methods like substring(), concatenate(), replace(), wrapper classes and Integer wrapper class methods, String class methods like length(), equals(), charAt(), compareTo(), constructors and constructor overloading, vector class methods like elementAt(), removeElement(), insertElementAt(), addElement(), visibility controls, use of "this" keyword, static fields and methods, garbage collection and finalize() method, array syntax and types, Object class and methods, difference between == and equals(), wrapper classes, and programming exercises on defining classes for students and employees, accepting user input into a vector and deleting/

Uploaded by

Vaibhav Bhagwat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 1

Assignment No.

1. Define a class and object. Write syntax to create class and object with an example.
2. What is method overloading? Give one example.
3. What is Vector? How it differs from array? Explain.
4. Explain the substring(), concate(), replace() methods of class string.
5. What are the applications of wrapper classes? Explain Integer wrapper class methods.
6. Describe following String class methods with example
(a)length() (b)equals() (c)charAt() (d)compareTo()
7. What is constructor? State its types. Explain constructor overloading with example.
8. Explain following methods of vector class:
(1) elementAt() (2) removeElement() (3) insertElementAt() (4)addElement()
9. Describe all visibility controls.
10. What is the use of “this” keyword? Explain its use with example.
11. Write a short note on Static fields and static methods.
12. What is garbage collection in java? Explain finalize( ) method.
13. Give the syntax of creating array. What are its types?
14. Explain Object Class and its methods.
15. Give the difference between == and equals( ).
16. Define Wrapper class.

Programming Exercise
1. Write a program to define a class student with rollno and name. Derive class
attendance with member as present_days. Write method to calculate and print
average attendance assuming total days as 180.
2. Define class „Employee‟ with data member empid, name and salary. Accept data for
5 objects and print it.
3. Write a program to accept as many integers as user wants in a vector. Delete specific
element and display remaining list.
4. Write a java program to implement visibility controls such as public, private,
protected access modes. Assume suitable data, if any.
5. Define a class person with data member as Aadharno, name, Panno implement
concept of constructor overloading. Accept data for 5 object and print it.

Subject Teacher

[Prof. M.B. Patil]

You might also like