Skip to main content

Posts

Showing posts matching the search for java

What is Java ? ,java introduction,Java definition, Java Fundamental

                    About Java:- Java is  a complete technology or platform,  which is used to create small scale to large scale application’s using Java Programming language, Java Development Kit and Java Frameworks. Java Technology Provide a complete platform to compile and execute the java program code using JDK and JRE . Java code converted into byte code by java compiler under JDK. Java Technology uses JVM (Java virtual machine ) to execute java byte code to any operating system hence Java is platform-independent but JVM dependent. JVM  is part of JRE. JVM is a subpart of JRE which is also called the virtual operating system of Java. In the developer machine, JDK and JRE both are required, but in the client machine, only JRE is required. About Java Programming language:- Java programming language is an Object-oriented programming language which is used to create a real-world based application for end-users. ...

Java Fundamental Interview Question

Java Fundamental Interview Question:- Test your Java Fundamental Skills  Java Fundamental Question is the first impression of the interview, if you not answering this then it provides a bad impression to the interviewer during the interview because you know first impression is the last impression. hence if you know very well advance skill and not know fundamental skills then you will never select in the interview. now I am helping you to provide fundamental interview questions of java. Q1)  What is Java?  Java is programming language or technology? initial stage Java was programming language? Q2)  Explain System.out.println(), what is System, what is out, what is println()? Q3)  How to take input from user's, explain System.in, what is Scanner class?, It is possible to take input without using Scanner class? Q4) Explain public static void main(), what is public, what is static, what is void, what is main()?, what is String args[] in main(), can we change args id...

JAVA 8 Features

 Overview of Java 8 Features Some of the important Java 8 features are; 1) forEach() method in Iterable interface 2) default and static methods in Interfaces 3) Functional Interfaces and Lambda Expressions 4) Java Stream API for Bulk Data Operations on Collections 5) Java Time API 6) Collection API improvements 7) Concurrency API improvements 8) Java IO improvements Now we discuss step by step these features 1. forEach() method in Iterable interface Whenever we need to traverse through a Collection, we need to create an Iterator whose whole purpose is to iterate over, and then we have business logic in a loop for each of the elements in the Collection. We might get ConcurrentModificationException if the iterator is not used properly. Java 8 has introduced forEach method in java.lang.Iterable interface so that while writing code we focus on business logic. The forEach method takes java.util.function.Consumer object as an argument, so it helps in having our business logic at a separa...

Notepad Code in Swing

Notepad Code in Swing:- package awtexample; import java.io.*; import javax.swing.JFileChooser; /**  *  * @author Hp  */ public class Notepad extends javax.swing.JFrame {     /**      * Creates new form Notepad      */     public Notepad() {         initComponents();     }     /**      * This method is called from within the constructor to initialize the form.      * WARNING: Do NOT modify this code. The content of this method is always      * regenerated by the Form Editor.      */     @SuppressWarnings("unchecked")     // <editor-fold defaultstate="collapsed" desc="Generated Code">                       ...

Core Java Interview Question for Experienced Candidate

Core Java Interview Question for an experienced candidate Top 20 Java Interview Question, Check Your Java Skills. 1)  What is annotation in Java, How we can create custom annotation? 2)  What is Reflection API in Java? 3)  How we can create Checked User Define Exception and  Unchecked User Define Exception? 4)  What is Inner class, Local Inner Class, Static Inner Class, Anonymous Class 5)   What is a Generic Class in Java  How we can define Custom Generic Class 6)  How we can Synchronize Array List? 7)   Which is the best Collection class to add and edit elements concurrently? 8)   What is the Marker interface, the difference between annotation and marker Interface? 9)    What will be the output when we call run() manually in Thread? 10)   What is the Design pattern in Java define Creational, Behavioral, and Structural Design Pattern? 11)    Difference between Comparable and Comparator? 12)...

Create First Program in JAVA

Software Tool For Java:- ........................................................................ 1 JDK + JRE  JDK (Java Development Kit) it is used to compile java program code to byte code. .JAVA ----> .Class JRE  (JAVA Runtime Environment) it is used to execute byte code(class file) to machine code using JVM(Java Virtual Machine). JVM is the virtual executor for java program code but JVM is operating System dependent. but .class file is common for all JVM. note:-  for developer or learner machine  :-  JDK+JRE for client machine :-   JRE (Java runtime environment) ................................................................................................................................................ How we check Java is installed in machine? go on program files and check Java (JDK+JRE) How we check that Java path is set or not? command prompt and type javac. if javac describes then the path is set. int...

OOPS Interview Question in Java, TOP 20 Interview question of Java

 OOPS Interview Question in Java:- OOP's is the most important topic of the interview, especially for JAVA. I am providing some most important interview questions based on OOP'S. 1)   What is OOPS? 2)   Why we use OOP'S technique in programming? 3)  What is the full form of OOP'S? 4)  What is the definition of Object, Class depends on object or Object is depend on class? 5) What is the difference between Object and Instance(reference)? 6)  What is the Garbage collector in Java, how it works? 7)  What are the Access modifier(Access Control, Access Specifier) and non-access modifiers in Java? 8) What is an immutable object in Java? 9) What is Singleton class, Concreate class,  Inner class in Java? 10) What is the final class, the final method, and the final variable in Java? 11)  What is another way to protect class from an inheritance except for the final class? 12) What is init block, static block, and constructor, if all three pres...

Mandatory Question for all Java learners and Java Job seeker

---Question for all Java learners and Java Job seeker--- In this article, I will discuss, some important questions of java. What is System.out.println() in Java?  What is public static void main(String args[])? If you know advance questions then ok, if you do not know silly questions then you will definitely be rejected on the interview hence focus on fundamentals then go for an advance topic. What is System.out.println() in Java?   System is the predefined final class of Java, which exists under java.lang package, It is used to manage input and output operation in java. When we want to take input from the keyboard in Java then System.in the reference variable will use, if we want to display output on any output screen such as to monitor, laptop, desktop, etc then System.out the reference variable will work. out is the static reference or static variable of PrintStream Class which is declared under System class. println():-   It is the predefined method of Pri...

How to create First "Hello World " Program in Java

1)  Check Java Environment Java software is installed in the machine or not, In the windows machine, we can check under c:/program files/java folder it should contain JDK and JRE both. JDK means Java Development Kit, It provides program compilation means convert java program code to byte code. JRE means Java Runtime Environment, It is used to Execute Java Byte Code to machine code using JVM (Java Virtual Machine), JIT (Just-in-time) Interpreter exist under JVM which is used to execute byte code result. If the Java environment is not set then install JAVA using JDK and JRE. 2)    Check the Java Environment path that it is set or not.  Open the command prompt and type javac , if javac will be described then the path is set otherwise the path is not set if javac not recognized internal or external command ... How we set java path:- Right click on mycomputer----> propeties  ---> Advance System setting ----> Environment Variable-----> New --->  ...

Should You Learn Java or .NET? An In-Depth Look

Should You Learn Java or .NET? An In-Depth Look  Many students often grapple with the question: Should I learn Java or .NET? Which technology has a better market presence? Will AI replace Java or .NET? These questions aren't just limited to students; many fresh graduates and developers ponder the same. Let's delve into this topic in detail. Market Trends The tech job market often sees fluctuations. Sometimes, .NET's market surges, while Java's market dips and vice versa. When you visit training centers, some people might tell you that there is no market for .NET and you should learn Java. Others may say the opposite, citing less competition in .NET. This can be confusing for anyone trying to decide which technology to learn. Platform Independence Java is platform-independent, meaning it can run on any operating system with JVM (Java Virtual Machine) support. It is an open-source technology with a strong community backing and supports languages like Kotlin and Scala. On ...

Serialization and Deserialization Tutorials in Java:-

Serialization means convert object data to Stream(file) and deserialization means Convert Stream(file)  to Object. Stream means the Sequence of bytes. for example, if we store student data into student objects and we want to write Student object data to file then we will use data serialization. If we have Student data in the file and we want to co-relate file data to object then we can use de-serialization. Java provides a  Serializable Interface to implement Serialization this interface does not contain any method it only contains behavior hence It is also called Marker Interface. Java Provide ObjectOuputStream Class and ObjectInputStream Class to Write and Read Data into Object.   Complete Example of Serialization and De-serialization? import java.io.*; class Student implements Serializable {    int rno;    String sname;    Student(int rno,String sname)    {       this.rno=rno;    ...