Wednesday, 15 July 2015

OBJECT CLASS,STRING CLASS IN JAVA WITH EXAMPLE


Object class:

It is a super class for every class we create in java.
Whenever we create an object for any class, it will load non static info (stub) related to that class as well as the complete stub of object class also into the memory location created for that object, so using the same reference we can use the non-static stub of that class as well as the complete stub of the object class in our program.
Note: object class is a special predefined class   

String class:
It is a predefined class in java which contains some predefined functions to perform different operations on string. We can call all those functions in our programs by creating a reference to the String class.

Predefined string functions in java useful for testing are as follows

Length (): finds the length of the string
Equals (): compares two strings, returns
 True if both are matching else returns
 False
subString(): selects a part of a string
indexOf():finds a word or a char in the
 string then returns index of the string ,
 if not find then returns -1
split(): splitting a string

Subscribe  channel to get  latest video
https://www.youtube.com/channel/UC1EmncBu2maDiHNMNNqxw9g

No comments:

Post a Comment