generic tag

3 questions


1 answers
104 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(...

2 years ago

1 answers
148 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 ...

2 years ago

1 answers
75 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...

2 years ago

© 2024 OneMinuteCode. All rights reserved.