Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newbranch #84

Open
wants to merge 7 commits into
base: hello
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
50 changes: 50 additions & 0 deletions Assignments/Easy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Beginner Java Assignment

## Task 1

Please do the following and send the files as a pull request -

1. Your task will be create a POJO.
1. Define two variables of any data type.
1. Initialize the variables through a parameterized constructor that takes in **both** the variables.
1. Create ```getter and setters``` for the two variables.
1. Override the ```toString()``` method of this class.

:sparkles: ```Bonus :``` Create a new class with a ```main()``` method, create objects of the above class and print the objects on the console.

## Task 2

Your task will be to simulate a **Grocery shop**.

1. Create a ```Fruit``` class and two subclasses of the ```Fruit``` class.
1. The ```Fruit``` class should contain the following variables -
1. fruitName of type ```String```
1. price of type ```float```
1. Create a parameterized constructor which takes in both the variables and then also a default non-parameterized constructor.
1. Override the ```toString()``` method.
1. Create getters and setters for all the variables.
1. Create a ```Vegetable``` class and two subclasses of the ```Vegetable``` class.
1. The ```Vegetable``` class should contain the following variables -
1. vegetableName of type ```String```
1. price of type ```float```
1. Create a parameterized constructor which takes in both the variables and then also a default non-parameterized constructor.
1. Override the ```toString()``` method.
1. Create getters and setters for all the variables.
1. Create a ```FruitAndVeggeShop``` class which contains the following variables -
1. ArrayList<Fruit>
1. ArrayList<Vegetable>
1. Create a parameterized constructor that takes in both the ArrayList's as arguments.
1. Create a method which prints all the fruits present in the ArrayList.
1. Create a method which prints all the vegetables present in the ArrayList.

:sparkles: **Bonus:** Print all the fruits present in the ArrayList using the forEach() method by making use of a method reference.

## Task 3

Complete the exercises present [here](https://www.hackerrank.com/domains/java)

Also try completing [this](https://www.hackerrank.com/domains/tutorials/30-days-of-code)

:sparkles: :sparkles:

<hr>
3 changes: 3 additions & 0 deletions Assignments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Java Assignments

This folder will contain ```Java``` assignments. It will be updated soon with a lot more problems. :sparkles:
17 changes: 0 additions & 17 deletions Fruits/Apple.java

This file was deleted.

13 changes: 0 additions & 13 deletions Fruits/Mango.java

This file was deleted.

6 changes: 0 additions & 6 deletions Fruits/StarApple.java

This file was deleted.

6 changes: 0 additions & 6 deletions Fruits/Strawberry.java

This file was deleted.

5 changes: 0 additions & 5 deletions Fruits/Watermelon.java

This file was deleted.

5 changes: 0 additions & 5 deletions Fruits/apple.java

This file was deleted.

13 changes: 0 additions & 13 deletions Fruits/grapes.java

This file was deleted.

5 changes: 0 additions & 5 deletions Fruits/pineapple.java

This file was deleted.

5 changes: 0 additions & 5 deletions Fruits/strawberry.java

This file was deleted.

1 change: 1 addition & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test