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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:43:40+00:00 2026-05-31T22:43:40+00:00

When I run char c= ‘\u0000’; System.out.println(c); in Eclipse,it prints a little square which

  • 0

When I run

char c= '\u0000'; 
System.out.println(c);

in Eclipse,it prints a little square which means a null character.
But it prints ‘a’ when I run it in CLI.
Then I run it on other computers, some print ‘a’, some print a space.

Why would this happen?

My OS is Windows 7 professional-32bit.The other systems are windows xp.
My java version is jdk_1.6.0update12.

  • 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-05-31T22:43:41+00:00Added an answer on May 31, 2026 at 10:43 pm

    It does not print a for me:

    public class Mkt {
     public static void main(String[] args) {
        char c= '\u0000'; 
        System.out.println("-" + c + "-");
      }
    }
    
    $ javac Mkt.java && java Mkt
    --
    

    Ubuntu 11.10 here:

    $ java -version
    java version "1.6.0_26"
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
    

    Things to check / try:

    • Change the font of your terminal window
    • Did you try with other Java versions on your machine?
    • Is there something different between your machine and others you tried?
    • Try it from within Cygwin
    • Try some different console emulator, e.g. Console
    • Redirect to file (java Mkt > some_file.txt) and see what’s in it, preferably with some hex editor
    • Make a small Swing application and display that in JTextArea to see if it displays the same
    • What does \u0001 display?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which doesn't run properly. char dec_number[300]; dec_number[0]='\0'; //some code
I run this piece of code on Visual C++ 2010 char c[10]; cin.get(&c[0],5); cin.get(&c[2],4);
here i want to run this program and take one character pointer like char
When I run this code: #include <stdio.h> typedef struct _Food { char name [128];
I use Delphi/NexusDB and I build SQL (about 800 char long) at run time
If I run: FILE* pFile = fopen(c:\\08.bin, r); fpos_t pos; char buf[5000]; int ret
I have defined an VARCHAR2(2000 CHAR) field in the database. Often, we run into
When I run the following code: #include <stdio.h> int main(int argc, char *argv[]) {
This code is giving me a segmentation fault at run time. char *str =
I get this error when I run rake db:migrate *db/migrate//004_add_data_to_measurement_type_and_measurement_unit.rb:3: invalid multibyte char (US-ASCII)

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.