Object reference( Creating a string in java three ways.)with example. - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Object reference( Creating a string in java three ways.)with example.

Object reference( Creating a string in java three ways.)with example.


Object reference: Object reference is unique hexadecimal number representing the memory address
of the object, it is useful to access the members of the object.
//Creating String
Creating a string in java three ways.
* String s;
 declare string type after next line insitialize
  s="hello" group of charactor

* String s="hello"; //declare and initialize(both)
s is reference variable

String class by allocated the memory  using the new operator
just like a creating a object .such as

* String object =new String("hello");

class CreateString
{
public static void main(String[]args)
{
String s="hello shashi";

System.out.println(s);

String s2=new String("shashikant");
System.out.println(s2);
}
}

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.