What is Static key word in Java ?
a static member is a member of a class that isn’t associated with an instance of a class. Instead, the member belongs to the class itself. As a result, you can access the static member without first creating a class instance.
What is String in Java ?
The
if we declare the string in method it should return some value
public static String test()
{
System.out.println("Testing");
return null;
}
a static member is a member of a class that isn’t associated with an instance of a class. Instead, the member belongs to the class itself. As a result, you can access the static member without first creating a class instance.
What is String in Java ?
The
String
class is immutable, so that once it is created a String
object cannot be changed. The String
class has a number of methods, some of which will be discussed below, that appear to modify strings. Since strings are immutable, what these methods really do is create and return a new string that contains the result of the operation.if we declare the string in method it should return some value
public static String test()
{
System.out.println("Testing");
return null;
}
No comments:
Post a Comment