Skip to content

Instantly share code, notes, and snippets.

@NishantMishra-1
Created March 19, 2021 08:27
Show Gist options
  • Save NishantMishra-1/15144bcddbb8413cb622baaf20716eb0 to your computer and use it in GitHub Desktop.
Save NishantMishra-1/15144bcddbb8413cb622baaf20716eb0 to your computer and use it in GitHub Desktop.
/* Created by IntelliJ IDEA.
* Author: Nishant Mishra (NishantMishra-1)
* Date: 01-02-2021
* Time: 10:39
* File: studentResult.java
*/
package Lab_Task_1_Feb;
import java.sql.ClientInfoStatus;
import java.util.*; //library file of java
class Employee {
private static String employeeName;
private static int employeeID;
private static String employeDesignation;
private static int employeeSalary;
@Override
public String toString() {
return String.format("%s",employeeName);
}
// private static Employee Employee;
// private static Employee employee;
public Employee(String employeeName, int employeeID, String employeDesignation, int employeeSalary) {
this.employeeName = employeeName;
this.employeeID = employeeID;
this.employeDesignation = employeDesignation;
this.employeeSalary = employeeSalary;
}
public String getEmployeeName() {
return employeeName;
}
public int getrollNumber() {
return employeeID;
}
public String getEmployeDesignation() {
return employeDesignation;
}
public int getEmployeeSalary() {
return employeeSalary;
}
public void setEmployeeName(String employeeName) {
employeeName = employeeName;
}
public void setStream(int employeeID) {
employeeID = employeeID;
}
public void setEmployeDesignation(String employeDesignation) {
employeDesignation = employeDesignation;
}
public void setEmployeeSalary(int employeeSalary) {
employeeSalary = employeeSalary;
}
public Employee() {
Employee[] employee = new Employee[2];
}
public static class LinkedList {
private static ClientInfoStatus last;
Node head; // head of list
// Linked list Node.
// This inner class is made static
// so that main() can access it
static class Node {
int data;
Node next;
// Constructor
Node(int d)
{
data = d;
next = null;
}
}
// Method to insert a new node
public static String insert(String list, int data)
{
// Create a new node with given data
Node new_node = new Node(data);
new_node.next = null;
// If the Linked List is empty,
// then make the new node as head
// Else traverse till the last node
// and insert the new_node there
// Return the list by head
return list;
}
@Override
public String toString() {
return "LinkedList{" +
"head=" + head +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LinkedList that = (LinkedList) o;
return Objects.equals(head, that.head);
}
@Override
public int hashCode() {
return Objects.hash(head);
}
// Method to print the LinkedList.
public static void printList(LinkedList list)
{
Node currNode = list.head;
System.out.print("LinkedList: ");
// Traverse through the LinkedList
while (currNode != null) {
// Print the data at current node
System.out.print(currNode.data + " ");
// Go to next node
currNode = currNode.next;
}
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
/* */
int i = 0;
for (i = 0; i < 2; i++) {
String employeeName = scanner.nextLine();
int employeeID = scanner.nextInt();
String employeDesignation = scanner.nextLine();
scanner.next();
int employeeSalary = scanner.nextInt();
Employee[] employee = new Employee[3];
/* Start with the empty list. */
String list = new String();
Arrays.sort(new int[]{employeeSalary});
// Print the LinkedList
System.out.println(Arrays.toString(employee));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment