Every Thread in java has some priority it may be default priority generated by JVM (or) explicitly provided by the programmer. The valid range of Thread priorities is 1 to 10 where 1 is the least priority and 10 is highest priority. Thread class defines the following constants to represent some standard priorities. 1) Thread. […]
A name in java program is called identifier. It could be class name, method name, variable name , e.t.c. Rules to define java identifiers: a-z,A-Z,0-9,_, $ are the only allowed characters in java identifiers. If we are using any other character we will get compile time error. Identifiers are not allowed to starts with digit. […]
java package or a package in java, it is like a normal packets contains the different things together, same as java packages contains the different classes , interface, enumerations together in it. java package is a logical container where classes and interfaces lives.It is a namespace in java ,declared at the top of the program, […]
There are two variants of finding a substring in java provided in String class first method which takes single argument substring(int beginIndex) Returns a new string that is a substring of this string.method will return part of characters from index beginIndex to end or the string The second method which takes two argument substring(int beginIndex, […]
a java example with one overridden method and one one overloaded method in child class , the overloaded method is called by the child object with parent reference,what will be the output of the program , this is one of the tricky interview questions asked in sequence of overloading/ overriding questions.
A class with same name methods but with different method arguments are known as overloaded methods . Method Overloading allows us to re use the same method name in a class , but with different arguments. Method overloading have only two rules:1. method name should be same2. method parameter types or number of parameters should […]
method overriding is a feature in object oriented programming that gives you the opportunity to override the method in child class which is defined in super class. it is a way to achieve run-time polymorphism, where the version of the method which will execute is get determine at run time. to understand method overriding we […]