A method stub in this sense is a method with no real substance, i.e. it’s not doing what it is intended to do. Your getUserNum()
method should return a user’s unique ID, but instead you’re defining a stub that simply returns -1
on every invocation.
You can tell from your main()
method, you’re supposed to be defining these two methods:
userNum1 = getUserNum(); avgResult = computeAvg(userNum1, userNum2);
So, define them. Here’s what the getUserNum()
stub would look like.
public static int getUserNum() { System.out.println("FIXME: Finish getUserNum()"); return -1; }
I’ll leave computeAvg()
up to the OP.
Related Posts:
- How to format strings in Java
- What exactly is Apache Camel?
- What is an instance variable in Java?
- How does the Java ‘for each’ loop work?
- How does the Java ‘for each’ loop work?
- What does “Could not find or load main class” mean?
- How do I create a file and write to it?
- When to use LinkedList over ArrayList in Java?
- How to convert a char to a String?
- How do you create a dictionary in Java? [closed]
- How do I declare and initialize an array in Java?
- Convert list to array in Java [duplicate]
- Convert String to double in Java
- How do I generate random integers within a specific range in Java?
- “Exception in thread “main” java.lang.IndexOutOfBoundsException: Index: 0, Size: 0″ with ArrayList?
- Raising a number to a power in Java
- Running JAR file on Windows 10
- Iterate through a HashMap [duplicate]
- exception in thread ‘main’ java.lang.NoClassDefFoundError:
- java.io.FileNotFoundException: the system cannot find the file specified
- How to parse this string in Java?
- How to match “any character” in regular expression?
- Double array initialization in Java
- I want to declare an empty array in java and then I want do update it but the code is not working
- Usage of @see in JavaDoc?
- Hadoop “Unable to load native-hadoop library for your platform” warning
- Why is there no Constant feature in Java?
- Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed
- Printing out a linked list using toString
- Using @RequestLine with Feign
- What is the best/simplest way to read in an XML file in Java application?
- Received fatal alert: handshake_failure through SSLHandshakeException
- DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704
- Why would a “java.net.ConnectException: Connection timed out” exception occur when URL is up?
- HashSet vs. ArrayList
- FIFO based Queue implementations?
- How to import a .cer certificate into a java keystore?
- Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0 error in Java
- How can I represent a range in Java?
- Android java.lang.IllegalStateException: Could not execute method of the activity
- Java error: Comparison method violates its general contract
- “Cannot create generic array of ..” – how to create an Array of Map
? - javac: file not found: first.java Usage: javac
- Eclipse Java error: This selection cannot be launched and there are no recent launches
- align text center with android
- hat is the purpose of flush() in Java streams?
- How can I convert integer into float in Java?
- Eclipse error, “The selection cannot be launched, and there are no recent launches”
- STS launch error – Java was started but returned exit code=13
- RecyclerView onClick
- Java, Shifting Elements in an Array
- error: bad operand types for binary operator ‘&&’
- Exception in thread “main” java.lang.ArithmeticException: / by zero
- Failed to load the JNI shared Library (JDK)
- “com.jcraft.jsch.JSchException: Auth fail” with working passwords
- java.util.NoSuchElementException – Scanner reading user input
- How would I use a while loop to keep requesting user input
- Array Required, but java.lang.String found
- Eclipse java debugging: source not found
- IntelliJ – Can’t start – “JAVA_HOME does not point to a valid JVM installation”
- Empty an array in Java / processing
- Class is not Abstract and does not Override error in Java
- Finding the size of a char array in Java
- Android For loop
- Java project in Eclipse: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- Replace a character at a specific index in a string?
- Error array dimension missing
- How to detect EOF in Java?
- Information about _JAVA_OPTIONS
- Two dimensional array list
- Must issue a STARTTLS command first
- Convert boolean to int in Java
- How to convert a String to CharSequence?
- How to easily convert a BufferedReader to a String?
- How can I calculate a time difference in Java?
- Detecting a long press with Android
- How to increase the size of an array in Java?
- Cannot invoke toString() on the primitive type int
- Creating a Calendar using javafx
- A tool for calculating the big-O time complexity of Java code? [closed]
- How to print binary tree diagram in Java?
- Must qualify the allocation with an enclosing instance of type GeoLocation
- Unknown version of Tomcat was specified in Eclipse
- How to compare character ignoring case in primitive types
- How can I wait for 10 second without locking application UI in android [duplicate]
- Java error “Value of local variable is not used”
- Is it okay to throw NullPointerException programmatically?
- Android: how to create Switch case from this?
- Read next word in java
- Convert float to double without losing precision
- Exception in thread “AWT-EventQueue-0” java.lang.OutOfMemoryError: Java heap space
- How do the post increment (i++) and pre increment (++i) operators work in Java?
- Manually throw an exception
- Spring boot: Unable to start embedded Tomcat servlet container
- How does paintComponent work?
- toring and Retrieving ArrayList values from hashmap
- Could not find or load main class with a Jar File
- “uses unchecked or unsafe operations” [duplicate]
- How do I enable index downloads in Eclipse for Maven dependency search?
- How to convert java.util.Date to java.sql.Date?