
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 33676 Articles for Programming

1K+ Views
In this problem, we are given a matrix. Our task is to create a program to print the sum of upper triangle and lower triangle.Lower triangleM00 0 0 … 0 M10 M11 0 … 0 M20 M21 M22 … ... Read More

7K+ Views
Complex numbers are those that have an imaginary part and a real part associated with it. They can be added and subtracted like regular numbers. The real parts and imaginary parts are respectively added or subtracted or even multiplied and divided.Example Live Demopublic class Demo{ double my_real; double my_imag; public Demo(double my_real, double my_imag){ this.my_real = my_real; this.my_imag = my_imag; } public static void main(String[] args){ Demo n1 = new Demo(76.8, 24.0), n2 = new Demo(65.9, 11.23), temp; ... Read More

1K+ Views
To check if a string is a valid keyword in Java, the code is as follows −Example Live Demoimport java.util.*; public class Demo{ static boolean valid_identifier(String my_str, int n){ if (!((my_str.charAt(0) >= 'a' && my_str.charAt(0) = 'A' && my_str.charAt(1) = 'a' && my_str.charAt(i) = 'A' && my_str.charAt(i) = '0' && my_str.charAt(i)

377 Views
OpenCSV has to be installed first, which is a parser library for Java. The dependency has to be mentioned in the pom.xml file in the maven project. After that, the below code can be utilized.Exampleimport java.io.FileReader; import java.io.*; public class Demo{ public static void readDataLineByLine(String file){ try{ FileReader my_filereader = new FileReader(file); CSVReader csvReader = new CSVReader(my_filereader); String[] nextRecord; while ((nextRecord = csvReader.readNext()) != null){ for (String cell : nextRecord){ ... Read More

7K+ Views
Class variables are also known as static variables, and they are declared outside a method, with the help of the keyword ‘static’.Static variable is the one that is common to all the instances of the class. A single copy of the variable is shared among all objects.Example Live Demopublic class Demo{ static int my_count=2; public void increment(){ my_count++; } public static void main(String args[]){ Demo obj_1=new Demo(); Demo obj_2=new Demo(); obj_1.increment(); obj_2.increment(); System.out.println("The count of first object is "+obj_1.my_count); ... Read More

844 Views
An object graph contains a set of objects that are automatically serialized given that the object that contains the reference is serialized too. Any object that is serialized and contains an object reference, the object reference will be serialized by the JVM.Example Live Demoimport java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; class One implements Serializable{ Two s2 = new Two(); } class Two implements Serializable{ Three s3 = new Three(); } class Three implements Serializable{ int i = 34; int j = 67; } public class Demo_Serialize{ public static void main(String args[]) throws Exception{ ... Read More

208 Views
Blockchain has become a buzz word in the recent times. It is being tried to be implemented in every software for various purposes, to check how it would work efficiently given different scenarios. It is a decentralized technology. It basically is data that is digital in nature and every piece of data is known as a transaction. Hence, the date, time and amount of that specific transaction is stored in the blockchain. Every block is unique due to the unique code it has, that is also known as ‘hash’. It is created with the help of different specialized algorithms.Investors are ... Read More

162 Views
Given the task is to find the maximum number without any leading or trailing zeroes or ones whose product of factorial of its digits is equal to the product of factorial of digits of the given number N.Let’s now understand what we have to do using an example −Input − N = 4912Output − 73332222Explanation − 4! * 9! * 1! * 2! = 7! * 3! * 3! * 3! * 2! * 2! *2! *2! = 17, 418, 240Input − N = 340Output − 3322Approach used in the below program as followsIn order to attain the maximum answer ... Read More

696 Views
Once the byte code is loaded by the JVM, (with the help of the .class file), the bytecode is checked to see the validity with the help of the verifier. The verifier checks the linking so as to perform operations efficiently. This way, the interpreter performs much efficiently. This process is known as verification.Example Live Demopublic class Demo{ private float my_val; float my_function(int my_val){ int balance = my_val; this.my_val += balance; return this.my_val; } public static void main(String[] args){ Demo my_obj = new Demo(); ... Read More

360 Views
Given the task is to find the maximum number that can be displayed using N segment on ant number of seven segment display.Let’s now understand what we have to do using an example −Input − N=5Output − 71Explanation − The largest number will be displayed as follows on the seven segment display −Input − N=6Output − 111Approach used in the below program as followsThe following situation can be divided into 3 case −Case 1 −If N is 0 or 1, then it is not possible to display any number.Case 2 −If N is odd. Then the numbers that can be ... Read More