- 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
Arushi has Published 157 Articles
Arushi
4K+ Views
A method with variable length arguments(Varargs) in Java can have zero or multiple arguments. Variable length arguments are most useful when the number of arguments to be passed to the method is not known beforehand. They also reduce the code as overloaded methods are not required.A program that demonstrates this ... Read More
Arushi
23K+ Views
An interface contains variables and methods like a class but the methods in an interface are abstract by default unlike a class. An interface extends another interface like a class implements an interface in interface inheritance.A program that demonstrates extending interfaces in Java is given as follows:Example Live Demointerface A { ... Read More
Arushi
8K+ Views
Instance variables are initialized using initialization blocks. However, the static initialization blocks can only initialize the static instance variables. These blocks are only executed once when the class is loaded. There can be multiple static initialization blocks in a class that is called in the order they appear in the ... Read More
Arushi
300 Views
Elements can be added at the end of a Vector using the java.util.Vector.add() method. This method has a single parameter i.e. the element to be added. It returns true if the element is added to the Vector as required and false otherwise.A program that demonstrates this is given as follows:Example Live ... Read More
Arushi
449 Views
Class objects can be created in Java by using the new operator. A class is instantiated by the new operator by allocating memory for the object dynamically and then returning a reference for that memory. A variable is used to store the memory reference.A program that demonstrates this is given ... Read More
Arushi
1K+ Views
Multilevel inheritance is when a class inherits a class which inherits another class. An example of this is class C inherits class B and class B in turn inherits class A.A program that demonstrates constructors in a Multilevel Hierarchy in Java is given as follows:Example Live Democlass A { A() ... Read More
Arushi
455 Views
A class declaration can contain a String instance and methods to set and get its value in Java.A program that demonstrates this is given as follows:Example Live Democlass Name { private String name; public void setName(String n) { name = n; } public String ... Read More
Arushi
1K+ Views
The zip code can be validated using the java.util.regex.Pattern.matches() method. This method matches the regular expression for the zip code and the given input zip code and returns true if they match and false otherwise.A program that demonstrates this is given as follows:Example Live Demopublic class Demo { public static ... Read More
Arushi
119 Views
The data members and methods of a class can be accessed only from within their declared class if they are specified with the private access modifier. The keyword private is used to specify this modifier.A program that demonstrates the private access modifier in Java is given as follows:Example Live Democlass A ... Read More
Arushi
323 Views
The java.util.Vector.setSize() method can be used to set the size of a Vector in Java. If the new size that is set is greater than the old size of the Vector, then null values are added to the positions created. If the new size that is set is lesser than ... Read More
To Continue Learning Please Login
Login with Google