- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Narasimha Murthi has Published 23 Articles
Narasimha Murthi
993 Views
Overriding is a one of the mechanisms to achieve polymorphism. This is the case when we have two classes where, one inherits the properties of another using the extends keyword and, these two classes same method including parameters and return type (say, sample).Since it is inheritance. If we instantiate the ... Read More
Narasimha Murthi
75 Views
Java provides three shift operators namely −Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand.Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand.Shift right zero fill ... Read More
Narasimha Murthi
58 Views
The java.lang.StringBuffer class is a thread-safe, mutable sequence of characters. Following are the important points about StringBuffer −A string buffer is like a String, but can be modified.It contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.They are ... Read More
Narasimha Murthi
103 Views
We can compare Strings in Java using the compareTo() method and the == operator.comapareTo() method − The compareTo() method compares two strings lexicographically.The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character ... Read More
Narasimha Murthi
153 Views
The java.util.StringTokenizer class allows an application to break a string into tokens.This class is a legacy class that is retained for compatibility reasons although its use is discouraged in new code.Its methods do not distinguish among identifiers, numbers, and quoted strings.This class methods do not even recognize and skip comments.Example Live ... Read More
Narasimha Murthi
90 Views
This class is used Join a sequence of characters separating using the delimiter.Examplepublic class StringJoinerSample { public static void main(String[] args){ StringJoiner sj = new StringJoiner(", "); sj.add("Krishna"); sj.add("Raju"); sj.add("Satish"); sj.add("Pruthvi"); System.out.println(sj); } }OutputKrishna, Raju, Satish, Pruthvi
Narasimha Murthi
3K+ Views
To compare two objects the object class provides a method with name equals(), this method accepts an object and compares it with the current object. If the references of these two objects are equal, then it returns true else this method returns false.ExampleIn the following example we have a class ... Read More
Narasimha Murthi
8K+ Views
A class in a blue print/user defined datatype in java that describes the behavior/state that the object of its type support.Examplepublic class Student { String name "Krishna"; int age = 20; void greet() { System.out.println("Hello how are you"); } }An object is an ... Read More
Narasimha Murthi
815 Views
The finalize() method belongs to the Object class. Right before closing an object, the garbage collector makes sure that there are no more references to it and, calls the finalize() method on it.Therefore, once you override the finalize() method in it, you can do all the cleanup activity like closing ... Read More
Narasimha Murthi
8K+ Views
Yes, you can pass objects as arguments in Java. Consider the following example: Here we have a class with name EmployeeExampleIn the following Java example, we a have a class with two instance variables name and age and a parameterized constructor initializing these variables.We have a method coypObject() which accepts ... Read More