Skip to main content

Featured

Difference between Fedora Workstation and Fedora Server

Fedora is a popular Linux distribution that is available in two primary editions: Fedora Workstation and Fedora Server. While both editions share the same underlying technology and software, they are designed with different use cases and target audiences in mind. In this article, we'll take a closer look at the differences between Fedora Workstation and Fedora Server to help you choose the best edition for your needs. Fedora Workstation Fedora Workstation is designed for desktop and laptop computers, and is aimed at developers, designers, and other creative professionals. It comes with a wide range of tools and applications that are tailored to these users, including integrated development environments (IDEs), software development kits (SDKs), and design tools. Some of the key features of Fedora Workstation include: GNOME Desktop: Fedora Workstation comes with the GNOME desktop environment, which provides a modern, user-friendly interface that is optimized for productivity and ease...

Java Stack Code Implementation

This how you write the code for Stack Data Structure...I think this will be helpful to you all   
public class Stack {
private int maxSize; // size of the stack array
private double [ ] stackArray;
private int top; // top in the stack array
public Stack(int s) {
maxSize =s; // set array size
stackArray = new double[maxSize];
top = -1; // no items
}
public void push(double j) {
// checking whether stack is full
if( top == maxSize - 1 ) {
System.out.println("Stack is full");
}
else {
// increment top and insert item
stackArray[++top] = j;
}
}
public double pop() {
if ( top == -1 ) {
System.out.println("Stack is Empty");
return -99;
}
else {
return stackArray[top--];
}
}
public double peek() {
if( top == -1 ) {
System.out.println("Stack is Empty");
return -99;
}
else
return stackArray[top];
}
public boolean isEmpty() {
return (top == -1);
}
public boolean isFull() {
return (top == maxSize -1);
}
}

Click here to see how you Implement StackApp.java

Comments