Can keys on Properties have quotes?

Posted on 2007-10-08
Last Modified: 2010-03-30
Can keys on Properties file have quotes?
String "font type"=Some font type

Question by:jamie_lynn
    LVL 92

    Expert Comment

    i don't think so.
    try it out, you may need to quote them \"
    LVL 8

    Accepted Solution

    Yes, they can.  If your .properties file has something like this:

    "test"=it worked can retrieve the value with this...

    Properties prop;
    // read in the .properties file
    System.out.println(prop.getProperty("\"test\"")); //prints "it worked"

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now