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 8425871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:23:37+00:00 2026-06-10T04:23:37+00:00

I am trying to convert an int into a String so that I can

  • 0

I am trying to convert an int into a String so that I can put the String values into an SQLite Cursor. I’ve tried multiple syntax and methods but none seem to work for me.

The Error occurs in MangaItemDB() while trying to convert any Int types aswell as the boolean.

I’ve looked through several articles like this one but none works for me.

Here’s my code:

public class MangaItem {

private int _id;
private String mangaName;
private String mangaLink;
private static String mangaAlpha;
private static int mangaCount;
private static int alphaCount;

private boolean mangaComplete = false;



public MangaItem MangaItemDB(int id, String mangaName, String mangaLink, String mangaAlpha, String mangaCount, String alphaCount, String mangaComplete) {
    MangaItem MangaItemDB = new MangaItem();
    MangaItemDB._id = id;
    MangaItemDB.mangaName = mangaName;
    MangaItemDB.mangaLink = mangaLink;
    MangaItemDB.mangaAlpha = mangaAlpha;
    MangaItemDB.mangaCount = String.valueOf(int mangaCount);
    MangaItemDB.alphaCount = Integer.toString(getAlphaCount());
    MangaItemDB.mangaComplete = String.valueOf(getMangaComplete());
    return MangaItemDB;


}

public void incrementMangaCount() {
    mangaCount++;
}

public int getMangaCount() {
    return mangaCount;
}

public void incrementAlphaCount() {
    alphaCount++;
}

public int getAlphaCount() {
    return alphaCount;
}

public boolean setMangaComplete(boolean mangaComplete) {
    return true;
}

public boolean getMangaComplete() {
    return mangaComplete;
}

/**
 * @return the mangaName
 */
public String getMangaName() {
    return mangaName;
}

/**
 * @param mangaName the mangaName to set
 */
public void setMangaName(String mangaName) {
    this.mangaName = mangaName;
}

/**
 * @return the mangaLink
 */
public String getMangaLink() {
    return mangaLink;
}

/**
 * @param mangaLink the mangaLink to set
 */
public void setMangaLink(String mangaLink) {
    this.mangaLink = mangaLink;
}

/**
 * @return the mangaAlpha
 */
public String getMangaAlpha() {
    return mangaAlpha;
}

/**
 * @param mangaAlpha the mangaAlpha to set
 */
public void setMangaAlpha(String mangaAlpha) {
    this.mangaAlpha = mangaAlpha;
}

/**
 * @return the _id
 */
public int get_id() {
    return _id;
}

/**
 * @param _id the _id to set
 */
public void set_id(int _id) {
    this._id = _id;
}

}

The lines :

    MangaItemDB.mangaCount = String.valueOf(mangaCount);
    MangaItemDB.alphaCount = Integer.toString(getAlphaCount());
    MangaItemDB.mangaComplete = String.valueOf(getMangaComplete());

all give “Type mismatch: cannot convert from String to Int”

  • 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-10T04:23:38+00:00Added an answer on June 10, 2026 at 4:23 am
    MangaItemDB.mangaCount = String.valueOf(int mangaCount);
    

    That code shouldn’t even compile. You shouldn’t pass the parameter type when calling a method, but instead when you call a method you simply pass in the parameter:

    MangaItemDB.mangaCount = String.valueOf(mangaCount);
    

    Please post all compilation errors if you have them so we don’t have to guess at them.

    Edit
    You state:

    MangaItemDB.mangaCount = String.valueOf(mangaCount);
    MangaItemDB.alphaCount = Integer.toString(getAlphaCount());
    MangaItemDB.mangaComplete = String.valueOf(getMangaComplete());
    

    all give “Type mismatch: cannot convert from String to Int”

    This suggests that you’re trying to assign Strings to int variables, and so there appears to be no need to convert the results to a String. Why not simply assign ints to ints and booleans to booleans?

    MangaItemDB.mangaCount = mangaCount;
    MangaItemDB.alphaCount = getAlphaCount();
    MangaItemDB.mangaComplete = getMangaComplete();
    

    Also, why are you using static variables? What is the justification for doing this? There are very specific times when you will want to use static variables, but most often your variables should be instance variables.

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

Sidebar

Related Questions

I'm trying to convert a string into an int so that I can keep
I am trying to convert a hashmap into an array, that I can put
I'm trying to put the values of a string into a byte array with
In MSSQL you can convert a string into an integer like this: CONVERT(INT, table.column)
Trying to convert this c code into MIPS and run it in SPIM. int
Trying to convert int arrays to string arrays in numpy In [66]: a=array([0,33,4444522]) In
I am trying to convert a String into an ArrayList. For example, my Struts2
I'm trying to convert a string value I retrieved from an XML parser into
Im trying to convert a string such as 12 August 2011 into time_t or
I am trying to convert an int to a cstring. I've decided to read

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.