
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Found 7442 Articles for Java

952 Views
Following is a simple example of a single dimensional array.Example Live Demopublic class Tester { public static void main(String[] args) { double[] myList = {1.9, 2.9, 3.4, 3.5}; // Print all the array elements for (double element: myList) { System.out.print(element + " "); } } }Output1.9 2.9 3.4 3.5

331 Views
Java supports single dimensional and multidimensional arrays. See the example below:Example Live Demopublic class Tester { public static void main(String[] args) { double[] myList = {1.9, 2.9, 3.4, 3.5}; // Print all the array elements for (double element: myList) { System.out.print(element + " "); } System.out.println(); int[][] multidimensionalArray = { {1,2},{2,3}, {3,4} }; for(int i = 0 ; i < 3 ; i++) { //row for(int j = 0 ; j < 2; j++) { System.out.print(multidimensionalArray[i][j] + " "); } System.out.println(); } } }Output1.9 2.9 3.4 3.5 1 2 2 3 3 4

2K+ Views
Following are various methods of Object class −protected Object clone() - Used to create and return a copy of this object. boolean equals(Object obj) - Used to indicate whether some other object is "equal to" this one.protected void finalize() - garbage collector calls this method on an object when it determines that there are no more references to the object.Class getClass() - Used to get the runtime class of this Object.int hashCode() - Used to get a hash code value for the object.void notify() - Used to wake up a single thread that is waiting on this object's monitor.void notifyAll() - ... Read More

6K+ Views
Yes, an overridden method can have a different access modifier but it cannot lower the access scope.The following rules for inherited methods are enforced -Methods declared public in a superclass also must be public in all subclasses.Methods declared protected in a superclass must either be protected or public in subclasses; they cannot be private.Methods declared private are not inherited at all, so there is no rule for them.

1K+ Views
I would recommend generateDS for converting a XSD file to a Python class . In my opinion, it is a good tool for the said purpose.It (generatS) generates the Python class with all methods (setters and getters, export to XML, import from XML). It does a good job and works very well !.

4K+ Views
In Java, an interface defined inside another interface or class is called nested interface. Interfaces are similar to classes, but they not contain instance variables, and their methods are declared without any body. You can specify what a class must do, but not how it does it using the interface keyword. In this article, we will learn about nested interfaces in Java. What is a Nested Interface in Java As mentioned earlier, we can declare an interface within another interface or class. Such an interface is termed as nested interface. It follows the same syntax as a regular interface ... Read More

4K+ Views
In Java, an interface defined inside another interface or class is called nested interface. Interfaces are similar to classes, but they not contain instance variables, and their methods are declared without any body. You can specify what a class must do, but not how it does it using the interface keyword. In this article, we will learn about nested interfaces in Java. What is a Nested Interface in Java As mentioned earlier, we can declare an interface within another interface or class. Such an interface is termed as nested interface. It follows the same syntax as a regular interface ... Read More

4K+ Views
In Java, an interface defined inside another interface or class is called nested interface. Interfaces are similar to classes, but they not contain instance variables, and their methods are declared without any body. You can specify what a class must do, but not how it does it using the interface keyword. In this article, we will learn about nested interfaces in Java. What is a Nested Interface in Java As mentioned earlier, we can declare an interface within another interface or class. Such an interface is termed as nested interface. It follows the same syntax as a regular interface ... Read More

6K+ Views
An abstract class can contain both abstract and non-abstract methods, whereas an Interface can have only abstract methods. Abstract classes are extended, while Interfaces are implemented. Read through this article to find out the other differences between an Abstract Class and an Interface and how they are used in real programs.What is an Abstract Class?An abstract class acts as a template that stores the methods and data members of a program. You should use an abstract class when you expect that it will inherited by different sub-classes with common methods and fields.Abstract classes may or may not contain abstract methods, ... Read More