Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:35:39+00:00 2026-06-17T15:35:39+00:00

MyProg.java:44: error: Type mismatch: cannot convert from void to SearchTree SearchTree nTree = nTree.insert(value);

  • 0

MyProg.java:44: error: Type mismatch: cannot convert from void to SearchTree

SearchTree nTree = nTree.insert(value);
                   ^^^^^^^^^^^^^^^^^^^

SearchTree.java:18: error: Type mismatch: cannot convert from void to int[]
value = Arrays.sort(value);

package ab12;
public class MyProg {
public static void main(String[] args) {
    QueueScheduler q = new QueueScheduler();
    int c = 0;
    for (int i = 0; i < 10; i++) {
        q.dynQueue[c].put(i);
        if (c == 2) {
            c = -1;
        }
        c++;
    }   
    Out.println("1. Random");
    Out.println(q.getRandom());
    Out.println(q.getRandom());
    Out.println(q.getRandom());
    Out.println("2. Priority");
    Out.println(q.getPriority());
    Out.println(q.getPriority());
    Out.println("3. RoundRobin");
    Out.println(q.getRoundRobin());
    Set set = new Set();
    Set other = new Set();
    String e = "Hallo";
    String e2 = "H.";
    String e3 = "red";
    String e4 = "blue";
    String e5 = "light";
    set.add(e);
    set.add(e2);
    set.add(e3);
    set.remove(e);
    other.add(e2);
    other.add(e3);
    other.add(e4);
    other.add(e5);
    set.union(other);
    set.difference(other);
    set.isSubsetOf(other);
    int value [] = new int[]{1, 3, 5, 7, 9, 13, 18, 19, 21};
    SearchTree nTree = nTree.insert(value);
    int s = nTree.sum();
    int num = nTree.numberOfLeafs();



     }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:35:40+00:00Added an answer on June 17, 2026 at 3:35 pm

    The error gives you all the information you need — you are trying to assign the result of a method call that returns void to a SearchTree. The insert method will not return the tree it was invoked on.

    I’m not sure what your intent actually is here. If you’re declaring SearchTree for the first time, then you won’t be able to call a method on it in the same statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#!/bin/sh files = 'ls /myDir/myDir2/myDir3/' for file in $files do echo $file java myProg
The following doesn't work in Java (an exception is thrown): Runtime.getRuntime().exec(cd mydir; myprog); The
I have a background process read from named pipe. for example mkfifo /tmp/log.pipe ./myprog.sh
package myProg; import java.util.Scanner; public class oving4a { /** *Øving 4a. Aleksander Pettersen */
I want to convert a org.w3c.dom.Document object to a String. I'm using Java 6
I want to adjust zsh so that I can tab complete: myprog <tab> using
I have a T-SQL stored procedure with the signature CREATE PROCEDURE MyProc @recordCount INT
Say I write this: from subprocessing import Popen, STDOUT, PIPE p = Popen([myproc], stderr=STDOUT,
When I started learning Java I too started with the ubiqutous Hello world app.
I've got some analysis code ( myprog ) that sucks in data using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.