generic tag

3 questions


1 answers
93 views
0
It's the calculation code for the four-day operation using Java generic stack, but the nullPointerException error keeps popping up

It's a code that uses generic stacksI keep getting a nullpointerception error like that.Below is the full code. } import java.util.*;class GStack<T> {static int top;Object [] stck;public GStack(...

1 years ago

1 answers
127 views
0
Creating a postfix calculator with java stack generic I don't know where the error is coming from.

package myfirstjava;import java.util.ArrayList;import java.util.Scanner;import java.util.StringTokenizer;class GStack<T> { static int top; Object[] stck; public GStack() { top = 0; stck = new ...

1 years ago

1 answers
64 views
0
C++ General Function Genericization Question.

void insert (int a, int b[], int index) { b[index] =a;}void insert (char a, char b, int index) { *(b+index) = a;}The goal is to make these two functions generalized generic functions, but I don't unde...

1 years ago

© 2024 OneMinuteCode. All rights reserved.