×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Lakshmi Srinivas
has Published
366
Answers
How to return an array from a method in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 03-Jan-2018 12:40:49
We can return an array in Java from a method in Java. Here we have a method createArray() from which we create an array dynamically by taking values from the user and return the created array.Example Live Demoimport java.util.Arrays; import java.util.Scanner; public class ReturningAnArray { public int[] createArray() { ...
Read More
How to create and populate Java array of Hash tables?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 03-Jan-2018 11:11:36
One way to create an array of hash tables is to create Hashtable objects and to assign these to a Hashtable array using curly braces:ExampleLive Demoimport java.util.Hashtable; public class HashTableOfArrays { public static void main(String args[]) { Hashtable<String, String> ht1 = new Hashtable(); ...
Read More
How to add elements to the midpoint of an array in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 02-Jan-2018 16:22:07
Apache commons provides a library named org.apache.commons.lang3 and, following is the maven dependency to add library to your project.<dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.0</version> </dependency> </dependencies>This package provides a class named ArrayUtils. You can add an element at a particular ...
Read More
What are the types of arrays in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 02-Jan-2018 15:22:52
There are two types of arrays in Java they are − Single dimensional array − A single dimensional array of Java is a normal array where, the array contains sequential elements (of same type) − int[] myArray = {10, 20, 30, 40} Example Live Demo ...
Read More
What is default, defender or extension method of Java 8?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 31-Dec-2017 15:52:16
Java 8 introduces a new concept of default method implementation in interfaces. This capability is added for backward compatibility so that old interfaces can be used to leverage the lambda expression capability of Java 8. For example, ‘List’ or ‘Collection’ interfaces do not have ‘foreach’ method declaration. Thus, adding such ...
Read More
What is the purpose of System class in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 31-Dec-2017 15:34:48
System class belongs to the package java.lang. It cannot be instantiated. A System class provides − standard output. error output streams. standard input and access to externally defined properties and environment variables. A utility method for quickly copying a portion of an array. a means of loading files and ...
Read More
How do we call a Java method recursively?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 29-Dec-2017 12:16:06
Recursion is where which a method class itself.Examplepublic class RecursionExample { private static long factorial(int n) { if (n == 1) return 1; else return n * factorial(n-1); } public static void main(String args[]) { ...
Read More
What is binding in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 29-Dec-2017 11:40:14
Association of method call with the method body is known as binding in Java. There are two kinds of binding. Static binding In static binding the method call is bonded with the method body at compile time. This is also known as early binding. This is done using static, private ...
Read More
What are vararg methods in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 29-Dec-2017 11:21:12
In Java methods, parameters accept arguments with three dots. These are known as variable arguments.sample(int args …){}If they are used you can pass a different number of arguments each time you call these methods.Examplepublic class Sample { void demoMethod(String... args) { for (String arg: args) { ...
Read More
What is a composition in Java?
Java 8
Object Oriented Programming
Programming
Lakshmi Srinivas
Published on 28-Dec-2017 17:14:30
The composition is also a type of aggregation where the relationship is restrictive i.e. If two objects are in composition, the composed object will not exist without the other.
Previous
1
...
31
32
33
34
35
36
37
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout