×
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
Johar Ali
has Published
71
Answers
How to create an array of Object in Java
Java 8
Object Oriented Programming
Programming
Johar Ali
Published on 06-Feb-2018 14:43:01
Array of Object class can be created which can accept any type of object. During operation on such array, instanceof operator can be used.Examplepublic class Tester { public static void main(String[] args) { Object[] dataArray = new Object[3]; dataArray[0] = new Integer(0); ...
Read More
How to declare a static String array in Java
Java 8
Object Oriented Programming
Programming
Johar Ali
Published on 06-Feb-2018 13:03:18
Following program shows how to declare a static string array.Examplepublic class Tester { private static String[] array; static { array = new String[2]; array[0] = "Hello"; array[1] = "World"; } public static void main(String[] args) { ...
Read More
How to initialize an array in Java
Java 8
Object Oriented Programming
Programming
Johar Ali
Published on 06-Feb-2018 11:30:17
Following example shows how to create and initialize an array.Examplepublic class Tester { public static void main(String[] args) { int[] dataArray = {1, 2, 3, 4}; for(int i: dataArray){ System.out.println(i); } } }
what is the simplest way to print a java array
Java 8
Object Oriented Programming
Programming
Johar Ali
Published on 06-Feb-2018 11:21:31
To make things simple, convert the array to list and then print it.Exampleimport java.util.Arrays; import java.util.List; public class Tester { public static void main(String[] args) { Integer[] numbers = {1, 2, 3, 4, 5}; List<Integer> list = Arrays.asList(numbers); System.out.println(list); ...
Read More
What is the use of marker interfaces in Java?
Java 8
Object Oriented Programming
Programming
Johar Ali
Published on 05-Feb-2018 14:38:38
An interface with no methods in it is referred to as a tagging interface. There are two basic design purposes of tagging interfaces -Creates a common parent As with the EventListener interface, which is extended by dozens of other interfaces in the Java API, you can use a tagging interface to ...
Read More
Creating and using packages in Java
Java
Java Programming
Java 8
Johar Ali
Published on 05-Feb-2018 11:17:45
While creating a package, you should choose a name for the package and include a package statement along with that name at the top of every source file that contains the classes, interfaces, enumerations, and annotation types that you want to include in the package. The package statement should be the ...
Read More
Can we inherit a final method in Java?
Java
Java Programming
Java 8
Johar Ali
Published on 02-Feb-2018 14:36:27
Yes, a final method is inherited but cannot be overridden.
Final class in Java
Java
Java Programming
Java 8
Johar Ali
Published on 02-Feb-2018 14:23:50
The main purpose of using a class being declared as final is to prevent the class from being subclassed. If a class is marked as final then no class can inherit any feature from the final class.public final class Test { // body of class }
How to print the content of JavaScript object?
Javascript
Web Development
Front End Technology
Johar Ali
Published on 01-Feb-2018 15:26:15
To print content of JavaScript object, you can try to run the following code. Here, the object is created using the new keyword −ExampleLive Demo<!DOCTYPE html> <html> <body> <p id="test"></p> <script> var dept = new Object(); ...
Read More
How do I hide an element when printing a web page?
CSS
Web Development
Front End Technology
Johar Ali
Published on 01-Feb-2018 15:13:12
To hide the element, add “display:none” to the element with CSS.<style> @media print { .noprint { visibility: hidden; } } </style>In addition, add the element, which you want to hide inside the <div>−<div id="noprint"> Add here the element, which you want to hide. </div>
Read More
1
2
3
4
5
6
7
8
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout