diff --git a/README.md b/Assignments/Advanced/README.md similarity index 100% rename from README.md rename to Assignments/Advanced/README.md diff --git a/Assignments/Easy/README.md b/Assignments/Easy/README.md new file mode 100644 index 0000000..16f6f47 --- /dev/null +++ b/Assignments/Easy/README.md @@ -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 + 1. ArrayList +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: + +
\ No newline at end of file diff --git a/Assignments/README.md b/Assignments/README.md new file mode 100644 index 0000000..96c1c2c --- /dev/null +++ b/Assignments/README.md @@ -0,0 +1,3 @@ +# Java Assignments + +This folder will contain ```Java``` assignments. It will be updated soon with a lot more problems. :sparkles: diff --git a/Fruits/Apple.java b/Fruits/Apple.java deleted file mode 100644 index ce8aadc..0000000 --- a/Fruits/Apple.java +++ /dev/null @@ -1,17 +0,0 @@ - -class Pear { - public static void main(String[] args) { - System.out.println("Apple !!"); - } -/** - * - * @author abhijit - * - */ -public class Apple { - - public static void main(String[] args) { - System.out.println("Apple"); - - } -} diff --git a/Fruits/Mango.java b/Fruits/Mango.java deleted file mode 100644 index 40f1a2f..0000000 --- a/Fruits/Mango.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - * @author abhijit - * - */ -public class Mango { - - public static void main(String[] args) { - System.out.println("Mango"); - - } - -} diff --git a/Fruits/StarApple.java b/Fruits/StarApple.java deleted file mode 100644 index 8bcd5cc..0000000 --- a/Fruits/StarApple.java +++ /dev/null @@ -1,6 +0,0 @@ -public class StarApple { - // Abhilash G - public static void main(String[] args) { - System.out.println("Star Apple !!"); - } -} \ No newline at end of file diff --git a/Fruits/Strawberry.java b/Fruits/Strawberry.java deleted file mode 100644 index 70f3518..0000000 --- a/Fruits/Strawberry.java +++ /dev/null @@ -1,6 +0,0 @@ -public class Strawberry { - public static void main(String[] args){ - //Hridya - System.out.println("I love Strawberries"); - } -} diff --git a/Fruits/Watermelon.java b/Fruits/Watermelon.java deleted file mode 100644 index 659058c..0000000 --- a/Fruits/Watermelon.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Watermelon { - public static void main(String[] args) { - System.out.println("Watermelons !!"); - } -} \ No newline at end of file diff --git a/Fruits/apple.java b/Fruits/apple.java deleted file mode 100644 index 25bac97..0000000 --- a/Fruits/apple.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Apple { - public static void main(String[] args) { - System.out.println("Apple !!");//Gopika - } -} diff --git a/Fruits/grapes.java b/Fruits/grapes.java deleted file mode 100644 index 7b5620e..0000000 --- a/Fruits/grapes.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - * @author abhijit - * - */ -public class grapes { - - public static void main(String[] args) { - System.out.println("grapes"); - - } - -} diff --git a/Fruits/pineapple.java b/Fruits/pineapple.java deleted file mode 100644 index 15d9d4d..0000000 --- a/Fruits/pineapple.java +++ /dev/null @@ -1,5 +0,0 @@ -public class pineapple { - public static void main(String[] args) { - System.out.println("Pineapple!!"); //Jasna - } -} diff --git a/Fruits/strawberry.java b/Fruits/strawberry.java deleted file mode 100644 index 3ab97e0..0000000 --- a/Fruits/strawberry.java +++ /dev/null @@ -1,5 +0,0 @@ -public class strawberry { - public static void main(String[] args) { - System.out.println("i love the strawberry !!"); - } -} diff --git a/test b/test new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/test @@ -0,0 +1 @@ +test