answersLogoWhite

0

The difference between 'a' and "a" anywhere in Java is that 'a' is a primitive char type, while "a" is a String object.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is the code required to convert an integer variable to a string variable in Java?

There are several different methods to convert an integer variable to a string variable in Java. For example, one can use the following code to convert an integer variable to a string variable: Integer.toString(number)


Which of these methods of string class is used to obtain character at specified index?

You don't specify "these methods", but chances are what you're looking for is the charAt method


Explain three different methods in java?

There are three different methods /functions in java are there : 1)computational methods.2)manipulative methods.3)procedural methods.


Which built in class in java contains only final methods?

String class


All types of String Functions in java?

Type the text String in your favorite IDE, and press F1 for help. You should get a list of all the methods available for the String class. Also check the StringBuffer class, which has some additional methods - for example, the capability of reversing a string. If you can't get the help this way, search the online Java documentation for String and StringBuffer. Here is the documentation of the Stringclass: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html


What is string buffer in java?

StringBuffer is java class available in java.lang package which provides mutable String object where String is immutable class. The methods of this class like reverse(), append(),insert() gives facility to insert data of the same object.


What is a function in java?

The term equivalent to functions in Java is "methods". Methods are pieces of code that are used to make some functionality. Ex: public String getName(){ return "Anand"; } The above is a sample method


Java program convert the inputed words into its upper case or lower case form?

There are methods in the String class; toUppercase() and toLowerCase(). i.e. String input = "Hello!"; String upper = input.toUpperCase(); //stores "HELLO!" String lower = input.toLowerCase(); //stores "hello!" -Note: these methods are NOT modifier methods therefore the original string is still "Hello!"


Is String in java a class or object?

String is a pre-defined class in Java. For example: String s = new String("This is a string"); the variable s is now a String object since it was declared and initialized in the String class.


Attributes and methods of uppercase in java?

In Java toUppercase() is a method of the class String: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toUpperCase()


What are some example for string formatting in Java?

There are lots of examples of string formatting in Java. It can be difficult at times. Some of these examples are, but are not limited to; align, string, format, and JAVA.


How can you write an interface name M and In the interface M place 2 methods named taste and smell both return String type in java program?

interface M { String taste(); String smell(); }


Can a main method in java be overloaded?

Yes. The main method is just like any other java method and can be overloaded. But - Only the method with public static void main(String[] args) signature will get invoked when the class is run.


Examples of codes in java?

public class Hello{//opens the classpublic static void main(String args[]){//opens the main methodSystem.out.println("Hello World");}//closes the main method}//closes the classNote: The compiler all the sentences that have "//" before them.


How can you prove the given string by user is array or not in java?

Strings and Arrays are two totally different data types in Java and they will not match with one another.


What does it mean to have a string split in java?

To have a string split in Java means that a string array, containing substrings (can be delimited by elements of a specified string or Unicode character array), is returned.


In computer terms what does the phrase 'java string replace' mean?

When referring to computer terms, the phrase "java string replace" means that a string in the line of code that Java uses, is being replaced, or needs to be replaced.


Is it possible to override overloaded methods why?

Yes. Overloaded methods are also Java methods and all Java methods can be overridden.


Where could someone find a tutorial explaining java string format?

You can go to the library to find a book on java string format that will explain it. You can also go to different places like Oracle or Homeandlearn to get more information on the subject.


How do you overload static methods in java?

Just create two methods with the same name, but with different types or numbers of parameters.