This is a test repo, please fork me!!! (^_^)/ This repository contains a simple test on Java Lambdas and Git.
Please follow the below mentioned instructions:
- Fork this repository
- Clone the forked the repository to your machine
- Create a new branch from the development branch
- Create a new folder 📁 and name it
Java
- Go into the Java directory
- Create a java file called Student
- Create a class Student
- Create the following fields and methods-
- String -> name [private]
- String -> rollNumber [private]
- String -> favoriteFruit [private]
- float -> height [private]
- float -> weight [private]
- Create getters and setters for these fields
- Create a argumented-constructor which takes in all the declared fields, and a no-arg constructor(default constructor)
- Create a driver class which contains a main method.
- Create a non-static method called
studentConsumer()
in the driver class. The method takes two in arguments, which are as follows:- An
ArrayList<T>
of students - A
Consumer<T>
functional interface
- An
- Inside the method body write the logic to consume the students in present in the
ArrayList<T>
by making use of theaccept(T t)
method of theConsumer<T>
functional interface. - Create an ArrayList of students and populate the list by taking input from the user.
- Call the
studentConsumer()
method inside the main thread, pass in the list of students and also write the logic to print the details of each student from the list. - Once the program executes and displays the output, commit the file
.java
file only.
- Now create a text file and write the name of your favorite fruit, song, and dessert.
- Commit the text file as well.
- Create a
.gitignore
file and add*.class
entry into it. - Commit this file as well.
- Finally, squash the last three commits into a single commit and send a pull request.
✨ Yay!! You're done. ✨