Java Assignment: Exploring Classes, Objects, and Inheritance

Verified

Added on  2024/05/29

|5
|673
|323
Homework Assignment
AI Summary
This Java assignment solution provides a detailed overview of classes, objects, and inheritance, focusing on practical implementation through class definitions like `Test`, `Camera`, `MobilePhone`, and `Tablet`. The `Test` class includes methods for reading repository data and order information, while the `Camera`, `MobilePhone`, and `Tablet` classes demonstrate inheritance and encapsulation with specific attributes and methods for each. The document outlines variable names, data types, and method signatures for each class, including methods for setting warranties, brand names, screen sizes, pixel counts, storage, colors, and operating systems. Additionally, it references external resources for further understanding of Java's object-oriented programming concepts, all available with more solved assignments and study tools on Desklib.
Document Page
P a g e | 1
Contents
Classes Details.......................................................................................................................................2
References.............................................................................................................................................5
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
P a g e | 2
Classes Details
Test class
Test
Contains all the test code and performs the functionalities
Variable name:
main() // method Return type :void and parameters: String
[]args
readRepository() // method Return type :void and parameters: int
catagory, int orderQuantity
readOrder() // method Return type :void
repository() // method Return type :void and int min_item, int
max_item, int min_stock, int max_stock
Camera class
Camera
Extends MobilePhone class
Variable name: int catagory;
double warranty;
String brandName;
double screenSize;
int setPixelCount;
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
1 getCameraInfo//method
2 setWarranty () // method
3 setBrandName () // method
4) setScreenSize() // method
5) setPixelCount () // method
1) Return type :void
2) Return type :void and parameters: double
warranty
3) Return type :void and parameters: String
brandName
4) Return type :void and parameters: double
screenSize
5) Return type :void and parameters: int
pixelCount
Document Page
P a g e | 3
MobilePhone class
MobilePhone
Contains description about mobiles
Variable name: int catagory;
double warranty;
String brandName;
double screenSize;
int storage;
String colour;
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
1 getMobileInfo //method
2 setWarranty () // method
3 setBrandName () // method
4) setScreenSize() // method
5) setStorage() // method
6) setColour // method
1) Return type :void and parameters: int
category
2) Return type :void and parameters: double
warranty
3) Return type :void and parameters: String
brandName
4) Return type :void and parameters: double
screenSize
5) Return type :void and parameters: int
storage
6) Return type :void and parameters: String
colour
Document Page
P a g e | 4
Tablet class
Tablet
Extends MobilePhone
Variable name: int catagory;
double warranty;
String brandName;
double screenSize;
int storage;
String operatingSystem;
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
Anywhere in class outside method
1 getTabletInfo//method
2 setWarranty () // method
3 setBrandName () // method
4) setScreenSize() // method
5) setStorage() // method
6) setOperatingSystem// method
1) Return type :void
2) Return type :void and parameters: double
warranty
3) Return type :void and parameters: String
brandName
4) Return type :void and parameters: double
screenSize
5) Return type :void and parameters: int
storage
6) Return type :void and parameters: String
operatingSystem
Interf Interface
Interf
Extends MobilePhone
Variable name:
int min_item
int max_item
int total_minimum_stock
int total_max_stock
Public and static , called with reference of
interface
Public and static , called with reference of
interface
Public and static , called with reference of
interface
Public and static , called with reference of
interface
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
P a g e | 5
References
Friesen, J. (2018). Java 101: Inheritance in Java, Part 1. Retrieved from
https://www.javaworld.com/article/2987426/core-java/java-101-inheritance-
in-java-part-1.html
Jamaludin, D. (2018). Java Class and Object Example. Retrieved from
https://www.djamware.com/post/584a792a80aca72c1ecc65be/java-class-
and-object-example
Object Oriented Programming in Java | Java OOPs Concepts | Edureka.
(2018). Retrieved from https://www.edureka.co/blog/object-oriented-
programming/
OOP Concepts for Beginners: What Is Inheritance? - DZone Java. (2018).
Retrieved from https://dzone.com/articles/oop-concept-for-beginners-what-
is-inheritance
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]