0% found this document useful (0 votes)
83 views

Java Programming (15Se205J) Assignment (Unit-Ii) Short Questions

This document outlines an assignment on Java programming concepts for a class. It lists 25 short answer questions covering topics like classes, objects, constructors, overloading, access specifiers, arguments, returning objects, finalize(), and the String and StringBuffer classes. It also provides 3 long answer questions on method overloading, constructor overloading, and inner/nested classes with examples for each.

Uploaded by

Ashish Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Java Programming (15Se205J) Assignment (Unit-Ii) Short Questions

This document outlines an assignment on Java programming concepts for a class. It lists 25 short answer questions covering topics like classes, objects, constructors, overloading, access specifiers, arguments, returning objects, finalize(), and the String and StringBuffer classes. It also provides 3 long answer questions on method overloading, constructor overloading, and inner/nested classes with examples for each.

Uploaded by

Ashish Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JAVA PROGRAMMING (15SE205J)

ASSIGNMENT (UNIT-II)
Short Questions:
1. What is a class? How does it accomplish data hiding?
2. How do classes help us to organize our programs?
3. What are objects? How are they created from a class?
4. What is a constructor? What are its special properties?
5. What are the differences between constructor and method of a class?
6. How do we invoke a constructor?
7. What is meant by constructor overloading?
8. What is meant by method overloading?
9. What is a default constructor?
10. What is a parameterized constructor?
11. List down the access specifiers available in java.
12. How will you invoke a member function?
13. What are the two ways to pass arguments in java?
14. How will you return objects from a member function?
15. What is the use of finalize() method?
16. What is the use of Garbage collector in java.
17. How does String class differ from the string buffer class?
18. List out any 5 methods available in string class
19. List out any 5 methods available in string buffer class
20. What is the use of valueOf() method?
21. What is the use of toString() method?
22. How will you convert numeric strings to primitive numbers using parsing method?
23. Restrictions for static method
24. Why java main method is static?
25. Explain the following:
a. Static variable
b. Static method
c. Static block

Long Questions:
1. Explain method overloading with an example program.
2. Explain in detail about constructor overloading with an example.
3. What are Inner classes and Nested Classes? Exaplain with an example of each.
4. Write and explain three uses of final keyword in Java with an example of each.
5. Explain about String class, String constructor, and different String methods using a
program.
6. Explain about StringBuffer class, StringBuffer constructor, and different StringBuffer
methods using a program.
7. Explain in detail about explicitly invoking garbage collector and finalize() method?

You might also like