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

java set 6 ass

The document contains a set of short-answer and practical questions related to Java programming concepts. Short-answer questions cover topics such as inheritance, method overloading, constructors, variable types, and the importance of loops. Practical questions require the implementation of a Mobile class, pattern printing, array operations, control structures, and the use of operators.

Uploaded by

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

java set 6 ass

The document contains a set of short-answer and practical questions related to Java programming concepts. Short-answer questions cover topics such as inheritance, method overloading, constructors, variable types, and the importance of loops. Practical questions require the implementation of a Mobile class, pattern printing, array operations, control structures, and the use of operators.

Uploaded by

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

Assignment Set 6

Short-Answer Questions:

1. What is inheritance? How does Java support inheritance?


2. Explain the concept of method overloading with an example.
3. What is the purpose of constructors in Java?
4. Explain the difference between local, instance, and static variables.
5. What is the importance of loops in programming?
Practical Questions:

1. OOP: Create a Mobile class with attributes brand, model, and price. Implement a
method to display mobile details.
2. Loop - Pattern Printing: Write a Java program to print the following pattern:markdown

* * * * *
* * * *
* * *
* *
*

3. Arrays: Write a program to nd the sum of even and odd numbers in an array
separately.
4. Control Structures: Write a program that checks if a given number is a perfect number
(sum of its factors excluding itself equals the number).
5. Operators: Write a Java program to demonstrate the use of relational and logical
operators.
fi

You might also like