Hi friends,
This is Rohit . we offer the great and excellent IT-services from last 15 years as a
software and hardware engineer.
If you want project at minimun price of 200rs contact us.
stay connected with our Youtube to learn more
https://www.youtube.com/watch?v=WKAfzoM0Pp8&t=56
Learn with us as new trend angular contact us on +91 9170190050
We provide services like : --
software and Website Development for our clients and Industrial Training for Students.
In the Industrial Training Phase : -
We provide training on various courses including mean and mern development.
like : --
Java & JSP | Spring & MySQL
JavaScript & Angular | Node/MySQL
HTML & CSS | JS & jQuery & Bootstrap
Networking & Basic of Computer
Basic of computer & Typing
PSD & HTML & CSS & JS & JQuery & Bootstrap
WireFrame & Software Testing
Brief Knowledge of Git Repository
Personality Development Program
Aptitude & Coding
Algorithmic Problem
JAVA
JavaScript
Angular
PHP
ASP.NET
Python
Android
Databases
Life Cycles
GD/PI
Yoga
In the Development Phase : -
We use water-fall and the latest agile methodology to develop a quality product.
Java is helpful to clear basic concept of coding with logic. I want to say coding is not a copy past but It can be defined as " coding is a simplified way of programming with logic. The term logic is representation of Type-Script and Type-Script is the enhance form of the features of JavaScript.
This is the Power point presentation on java basic to advance free download. and share to your friends . Believe in yourself. Learn java with this ppt and grow your career. Get Job .
Don't believe any other person always believes in yourself and do self Study. Get Job
All the Best.
We make this ppt with the help of more than one book and my own knowledge and Experience.
I hope this is very helpful for you
and once more
I have been added new series of this ppt as pdf now you can download and read this from today june 06, 2020 .
In this pdf java series I have been added the concept of Java Exceptions with easy manner.
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
All the very best for your future job
#advance java ppt, #android ppt learn before java ppt, #basic to advance java ppt download, #complete java ppt, #core java download, #core java ppt, #dot net ppt learn before java ppt, #download java, #download java ppt, #free complete java ppt basic to advance, #free java ppt, #java, #java ppt, #java then android ppt learn,# java tutorial, #learn java, #learn java basic to advance, #php ppt learn after this, #ppt, #coding
This document contains details of Mr. Rohit Raj Singh's personal information, education qualifications, work experience, languages known, present and permanent addresses, family details, expected salary and self-declaration. Some key details include:
- He has a Bachelor's degree in Computer Science and Engineering from UP Technical University with 68% marks.
- His total work experience is 37 months including positions at Netsmartz Infotech, Hays Business Solutions, GluedIn Private Limited and Mobiloitte Private Limited.
- His current location is Lucknow and preferred locations include Lucknow, Bangalore and Varanasi.
- He declares that he has no pending civil, criminal, disciplinary cases or charges against him.
This document defines methods for initializing and updating date values for a calendar component in Angular. It initializes minimum and maximum date values, gets the selected from and to date values, and resets the date values back to empty strings.
This document outlines topics related to data entry and data mining, including definitions of data entry and data mining, advantages and disadvantages of each, companies that use them, relevant techniques and areas, file formats, communication skills, and requirements for data entry projects. It provides contact information for an individual offering data entry and data mining services and lists 18 topics that will be covered related to skills development and understanding of data entry and data mining.
Coding Development Skills Program
you need to submit the solution of this "assignment 1" within 1 month. If you not submit the solution of the assignment within allowtted time then 2 marks will be deducted per day.
our mathematics classes --
https://youtu.be/KleKFXSXGPY
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
#learn Java
#php
#jsp
#networking
#Angular
#ionic4
#spring
#node
#Android
#Dot Net
#C#
#C sharp
Angular custom pagination Implementation simplified
for mathematics classes visit the below link ---
https://www.youtube.com/watch?v=KleKFXSXGPY&t=853s
https://www.youtube.com/watch?v=g07wTZYYzKo&t=188s
for physics classes visit the below link --
https://www.youtube.com/watch?v=6ha1sxMy4mU
https://www.youtube.com/watch?v=2k5uI6Gm-8Y
our facebook link --
https://www.facebook.com/Online-Smart-Classes-108395901487258
Sql exception and class notfoundexceptionRohit Singh
The document discusses JDBC exception handling in Java. It provides details on the SQLException class which is commonly thrown for JDBC errors. It describes methods like getErrorCode(), getMessage(), getSQLState() available on the SQLException object to retrieve additional error information. It then provides an example using try, catch, finally blocks to handle exceptions during JDBC operations like connecting to a database and executing queries. Specific exceptions like ClassNotFoundException are also discussed.
This will give the basic knowledge of Angular. We have been uploaded Angular part 1 and Angular part 2 key notes that gives the knowledge of angular in a well defined manner you can learn also .
Campus Automation System is my project. This project are developed with the help of java and advance java server pages.
This is full description of my project. This is the one of the best project topic which is in trend you can also add more feactures in this topic to make new in the current trend like ---
Exam , Attendance, and tutorial and you also add a test module for student for one month successful training complition of this project.
#attendance,
#campus automation system,
#jsp project ppt,
#ppt,
#project,
#java project ppt,
#test module,
#tutorial
This document contains details of Mr. Rohit Raj Singh's personal information, education qualifications, work experience, languages known, present and permanent addresses, family details, expected salary and self-declaration. Some key details include:
- He has a Bachelor's degree in Computer Science and Engineering from UP Technical University with 68% marks.
- His total work experience is 37 months including positions at Netsmartz Infotech, Hays Business Solutions, GluedIn Private Limited and Mobiloitte Private Limited.
- His current location is Lucknow and preferred locations include Lucknow, Bangalore and Varanasi.
- He declares that he has no pending civil, criminal, disciplinary cases or charges against him.
This document defines methods for initializing and updating date values for a calendar component in Angular. It initializes minimum and maximum date values, gets the selected from and to date values, and resets the date values back to empty strings.
This document outlines topics related to data entry and data mining, including definitions of data entry and data mining, advantages and disadvantages of each, companies that use them, relevant techniques and areas, file formats, communication skills, and requirements for data entry projects. It provides contact information for an individual offering data entry and data mining services and lists 18 topics that will be covered related to skills development and understanding of data entry and data mining.
Coding Development Skills Program
you need to submit the solution of this "assignment 1" within 1 month. If you not submit the solution of the assignment within allowtted time then 2 marks will be deducted per day.
our mathematics classes --
https://youtu.be/KleKFXSXGPY
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
#learn Java
#php
#jsp
#networking
#Angular
#ionic4
#spring
#node
#Android
#Dot Net
#C#
#C sharp
Angular custom pagination Implementation simplified
for mathematics classes visit the below link ---
https://www.youtube.com/watch?v=KleKFXSXGPY&t=853s
https://www.youtube.com/watch?v=g07wTZYYzKo&t=188s
for physics classes visit the below link --
https://www.youtube.com/watch?v=6ha1sxMy4mU
https://www.youtube.com/watch?v=2k5uI6Gm-8Y
our facebook link --
https://www.facebook.com/Online-Smart-Classes-108395901487258
Sql exception and class notfoundexceptionRohit Singh
The document discusses JDBC exception handling in Java. It provides details on the SQLException class which is commonly thrown for JDBC errors. It describes methods like getErrorCode(), getMessage(), getSQLState() available on the SQLException object to retrieve additional error information. It then provides an example using try, catch, finally blocks to handle exceptions during JDBC operations like connecting to a database and executing queries. Specific exceptions like ClassNotFoundException are also discussed.
This will give the basic knowledge of Angular. We have been uploaded Angular part 1 and Angular part 2 key notes that gives the knowledge of angular in a well defined manner you can learn also .
Campus Automation System is my project. This project are developed with the help of java and advance java server pages.
This is full description of my project. This is the one of the best project topic which is in trend you can also add more feactures in this topic to make new in the current trend like ---
Exam , Attendance, and tutorial and you also add a test module for student for one month successful training complition of this project.
#attendance,
#campus automation system,
#jsp project ppt,
#ppt,
#project,
#java project ppt,
#test module,
#tutorial
Learn networking? 5G Technology,Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
Learn c language Important topics ( Easy & Logical, & smart way of learning)Rohit Singh
Learn C language with an easy way including all important topics in C.
Learn c language Important topics ( Easy & Logical, & smart way of learning)
preprocessor Directive, Search Strategy, Header file, return 0 in C, return, main function, flow of execution, explicit return, function, return type and non return type function. Run- time Environment, type specifier, void keyword, 32 keyword in C, openning curly brace and closing curly brace, system library, single argument, String literal is an unnamed array with element of type char.
First program of C ( Complete Explanation )Rohit Singh
preprocessor Directive, Search Strategy, Header file, return 0 in C, return, main function, flow of execution, explicit return, function, return type and non return type function. Run- time Environment, type specifier, void keyword, 32 keyword in C, openning curly brace and closing curly brace, system library, single argument, String literal is an unnamed array with element of type char.
Steps of Learning Programming Language. and much more with and easy way. Like ---
History of C language, What is C, Step by step procedure to learn C language with interview questions.
C, C language ppt, Learn C, Basic C, What is C?, How to learn C, language, programming language ppt, OOPs, POOPs, Learn C ppt, C ppt, C Program, first program, Variable in C, Keyword in C, constant in C ?
CCNA is associate level career certification. It is an International certification course. Which is helpful to improve your career path in networking field. It gives lot of opportunity for Engineers and lots of opportunity having lots of job.
But now in these days,
This International course is offered by SMS Institute of Technology, Lucknow
So ,
There is no need to go anywhere for the training on CCNA Course Certification during summer Training.
I want to give this information because lots of people think about this course. But they have no any other way like - going to the training institute that offers CCNA Training But they give the certification on Own training Institute That is invalid Because CCNA is a International course Certification and these certificate are come on the email Id.
But Now this course Certification offers by SMS Institute of Technology But the certificate are valid through out the world.
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
This is the ppt that contain the basic topics of HTML. This is helpful to improve the knowledge of html and It is also for beginner.
That gives the basic knowledge of html.
This is the power point presentation on Software Testing. Software Testing is the process of finding error or bug in the developed software product based on the client requirement.
This power point presentation give the basic knowledge about the software testing.
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
for mathematics classes visit the below link ---
https://www.youtube.com/watch?v=g07wTZYYzKo&t=188s
https://www.youtube.com/watch?v=KleKFXSXGPY&t=853s
for physics classes visit the below link --
https://www.youtube.com/watch?v=6ha1sxMy4mU
https://www.youtube.com/watch?v=2k5uI6Gm-8Y
our facebook link --
https://www.facebook.com/Online-Smart-Classes-108395901487258
#coding
#coding development skill program
#java
These question are the basic questions for Interview based on Java language. These questions are able to crack the interview based on java language
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
Learn networking? 5G Technology,Learn c language Important topics ( Easy & Logical, & smart way of learning)
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
Learn c language Important topics ( Easy & Logical, & smart way of learning)Rohit Singh
Learn C language with an easy way including all important topics in C.
Learn c language Important topics ( Easy & Logical, & smart way of learning)
preprocessor Directive, Search Strategy, Header file, return 0 in C, return, main function, flow of execution, explicit return, function, return type and non return type function. Run- time Environment, type specifier, void keyword, 32 keyword in C, openning curly brace and closing curly brace, system library, single argument, String literal is an unnamed array with element of type char.
First program of C ( Complete Explanation )Rohit Singh
preprocessor Directive, Search Strategy, Header file, return 0 in C, return, main function, flow of execution, explicit return, function, return type and non return type function. Run- time Environment, type specifier, void keyword, 32 keyword in C, openning curly brace and closing curly brace, system library, single argument, String literal is an unnamed array with element of type char.
Steps of Learning Programming Language. and much more with and easy way. Like ---
History of C language, What is C, Step by step procedure to learn C language with interview questions.
C, C language ppt, Learn C, Basic C, What is C?, How to learn C, language, programming language ppt, OOPs, POOPs, Learn C ppt, C ppt, C Program, first program, Variable in C, Keyword in C, constant in C ?
CCNA is associate level career certification. It is an International certification course. Which is helpful to improve your career path in networking field. It gives lot of opportunity for Engineers and lots of opportunity having lots of job.
But now in these days,
This International course is offered by SMS Institute of Technology, Lucknow
So ,
There is no need to go anywhere for the training on CCNA Course Certification during summer Training.
I want to give this information because lots of people think about this course. But they have no any other way like - going to the training institute that offers CCNA Training But they give the certification on Own training Institute That is invalid Because CCNA is a International course Certification and these certificate are come on the email Id.
But Now this course Certification offers by SMS Institute of Technology But the certificate are valid through out the world.
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
This is the ppt that contain the basic topics of HTML. This is helpful to improve the knowledge of html and It is also for beginner.
That gives the basic knowledge of html.
This is the power point presentation on Software Testing. Software Testing is the process of finding error or bug in the developed software product based on the client requirement.
This power point presentation give the basic knowledge about the software testing.
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
for mathematics classes visit the below link ---
https://www.youtube.com/watch?v=g07wTZYYzKo&t=188s
https://www.youtube.com/watch?v=KleKFXSXGPY&t=853s
for physics classes visit the below link --
https://www.youtube.com/watch?v=6ha1sxMy4mU
https://www.youtube.com/watch?v=2k5uI6Gm-8Y
our facebook link --
https://www.facebook.com/Online-Smart-Classes-108395901487258
#coding
#coding development skill program
#java
These question are the basic questions for Interview based on Java language. These questions are able to crack the interview based on java language
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
2. Introduction
Firstly, it was called "Greentalk" by James Gosling and file
extension was .gt.
After that, it was called Oak and was developed as a part of the
Green project.
James Gosling and Sun Microsystems.
Java, May 20, 1995, Sun World
HotJava, The first Java-enabled Web browser
3. History
The history of Java is very interesting. Java was originally
designed for interactive television, but it was too advanced
technology for the digital cable television industry at the time.
The history of java starts from Green Team. Java team members
initiated this project to develop a language for digital devices
such as set-top boxes, televisions etc. But, it was suited for
internet programming. Later, Java technology was incorporated
by Netscape
James Gosling, Mike Sheridan, and Patrick
Naughton initiated the Java language project in June 1991. The
small team of sun engineers called Green Team.
4. What is Java ?
Java is a secure programming language that follows OOPs Java
is a high level, robust, secured and object-oriented programming
language.
The most important feacture’s of java is plateform independent.
Java's platform independence is achieved by the use of the JVM
(Java Virtual Machine).
When a Java program is compiled the .java files are fed to a
compiler which produces a .class file for each .java file
The .class file contains Java bytecode.
Bytecode is like machine language, but it is intended for the
Java Virtual Machine not a specific chip such as a Pentium or
PowerPC chip
5. Characteristic of Java
Java is simple
Java is dynamic
Java is portable
Java is secure
Java is object-oriented
Java is multithreaded
Generics
Collection
6. Plateform
Any hardware or software environment in which a program
runs, is known as a platform. Since Java has its own runtime
environment (JRE) and API, it is called platform.
7. Java IDE
IDE means the Environment in which Java Programs or
Applications are Developed and Run.
Netbean
Eclipse
9. What is JDK, JRE and JVM?
Jdk provide development tool to Develop and
Run the Java Program for Developers.
JRE provide Environment to Run the Java
Application for Clients.
JVM is Responsible to Run the Java Program
or Application Line by Line for Developers
and Client both.
JDK = JRE + Development Tools
JRE = JVM + Library Classes.
10. Architecture of Jdk
jdk contains the Java Runtime Environment (JRE), an
interpreter/loader (java), a compiler (javac), an archiver (jar), a
documentation generator (javadoc) and other tools needed
in Java development.
11. Architecture of JRE
JRE is an acronym for Java Runtime Environment.
It is the implementation of JVM. It physically exists. It contains
set of libraries + other files that JVM uses at runtime.
12. JVM
JVM (Java Virtual Machine) is an abstract machine that
provides runtime environment in which java bytecode can be
executed.
JVM, JRE and JDK are platform dependent because
configuration of each OS differs. But, Java is platform
independent.
The JVM performs following main tasks:
1. Loads code
2. Verifies code
3. Executes code
4. Provides runtime environment
16. Anatomy of a Java Program
Comments
Package
Reserved words
Modifiers
Statements
Blocks
Classes
Methods
The main method
17. Comments
We use the Comment to enhancing the readability of our
program.
In Java, comments are preceded by two forward slashes (//) in a
line
Multiline Comment enclosed between /* and */ in one or
multiple lines.
When the compiler sees //, it ignores all text after // in the same
line.
When it sees /*, it scans for the next */ and ignores any text
between /* and */.
18. Package
The second line in the program specifies a package name, A
Package is a namespace that organize a set of related classes and
interfaces.
19. Keyword
Reserved words or keywords are words that have a specific
meaning to the compiler and cannot be used for other purposes
in the program. For example, when the compiler sees the word
class, it understands that the word after class is the name for the
class. Other reserved words are as public, static, and void. Their
use will be introduced later in the book.
20. Modifiers
Java uses certain reserved words called modifiers that specify
the properties of the data, methods, and classes and how they
can be used. Examples of modifiers are public and static. Other
modifiers are private, final, abstract, and protected. A public
datum, method, or class can be accessed by other programs. A
private datum or method cannot be accessed by other programs.
21. Statement
A statement represents an action or a sequence of actions.
The statement System.out.println("Welcome to Java!") in the
program in Example 1.1 is a statement to display the greeting
"Welcome to Java!" Every statement in Java ends with a
semicolon (;).
22. Blocks
A pair of braces in a program forms a block that groups
components of a program.
public class Test {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Class block
Method block
23. Methods
What is System.out.println? It is a method:
a collection of statements that performs sequence of operations
to display a message on the console.
It can be used even without fully understanding the details of
how it works.
It is used by invoking a statement with a string argument. The
string argument is enclosed within parentheses. And the
argument is "Welcome to Java!" You can call the same println
method with a different argument to print a different message.
24. Main Method
The main method provides the control of program flow. The Java
interpreter executes the application by invoking the main method.
The main method looks like this:
public static void main(String args[]) {
// Statements;
25. class
The class is the essential Java construct. A class is a template or
blueprint for objects. To program in Java, you must understand
classes and be able to write and use them .
A program can contain more than one classes.
26. Types of Java Edition
Java SE (Standard Edition)
Java EE (Enterprise Edition)
Java MC (Micro Edition)
Java TV (Television Edition)
Java Card (Sim Card)
27. Types of Application made by
java
Standalone Application
Enterprise Application
Mobile Application
Web Application
28. Naming Convention
Java naming convention is a rule to follow as you decide what
to name your identifiers such as class, package, variable,
constant, method etc.
But, it is not forced to follow. So, it is known as convention not
rule.
All the classes, interfaces, packages, methods and fields of java
programming language are given according to java naming
convention.
30. What happens at Runtime?
Classloader: is the subsystem of JVM
that is used to load class files.
Bytecode Verifier: checks the code
fragments for illegal code that can violate
access right to objects.
Interpreter: read bytecode stream then
execute the instructions.
31. Can you save a java source file by
other name than the class name?
Yes, if the class is not public.
32. Can you have multiple classes
in a java source file?
Yes , A class can contains more than one class.
33. Variables in Java
A variable is a container which holds the value while the java
program is executed. A variable is assigned with a data-type.
Data Type describes the size of variable ,default value, Which
type of value are stored.
Variable is a name of memory location. Eg. int a=10;
35. Types of Variables
1. Local Variable:
A variable declared inside the method is called local
variable.
2. Instance Variable:
A variable declared inside the class but outside the method, is
called instance variable . It is not declared as static.
3. Static variable:
A variable which is declared as static is called static
variable. It cannot be local.
36. Data Types
Data types represent the different values to be stored in the
variable. In java, there are two types of data types:
Primitive data types
Non-primitive data types
37. Java Heap and Stack Memory
Heap Memory Stack Memory
Heap Memory is created by the Java
Virtual Machine when it starts. The
memory is used as long as the
application is running.
When an object is created, it is
always created in Heap and has
global access. That means all objects
can be referenced from anywhere in
the application.
Stack Memory is the temporary
memory where variable values are
stored when their methods are
invoked. After the method is finished,
the memory containing those values
is cleared to make room for new
methods.
When a new method is invoked, a
new block of memory will be created
in the Stack.
38. Heap and Stack Memory e.g.
class Student8{
int rollno;
String name;
static String college ="ITS";
Student8(int r,String n){
rollno = r;
name = n;
}
..void display ()
{
System.out.println(rollno+" "+name+" "+college);}
public static void main(String args[]){
Student8 s1 = new Student8(111,"Karan");
Student8 s2 = new Student8(222,"Aryan");
s1.display();
s2.display();
}
}
39. Operators in java
Operator in java is a symbol that is used to perform operations.
40. How to take input from user
By using Scanner Class
42. OOPs Concept
Object means a real word entity such
as pen, chair, table etc. Object-
Oriented
Programming is a methodology or
paradigm to design a program using
classes and objects.
Programming simplifies the software
development and maintenance by
providing some concepts:
43. Object and Class
Object :
Any entity that has state and behavior is known as an object.
For example: chair, pen, table, keyboard, bike etc. It can be physical
and logical.
Class :
Collection of objects is called class. It is a logical entity.
44. Abstraction
Hiding internal details and showing functionality is known as
abstraction. For example: phone call, we don't know the internal
processing.
In java, we use abstract class and interface to achieve
abstraction.
45. Encapsulation
Binding (or wrapping) code and data together into a single
unit is known as encapsulation. For example: capsule, it is
wrapped with different medicines.
A java class is the example of encapsulation. Java bean is the
fully encapsulated class because all the data members are
private here.
We can create a fully encapsulated class in java by making all
the data members of the class private. Now we can use setter
and getter methods to set and get the data in it
46. Inheritance and Polymorphism
Inheritance :
When one object acquires all the properties and
behaviours of parent object i.e. known as inheritance. It provides
code reusability. It is used to achieve runtime polymorphism.
47. When one task is performed by different ways i.e. known as polymorphism.
Polymorphism
48. Java Package
A java package is a group of similar types of classes, interfaces
and sub-packages.
Package in java can be categorized in two form, built-in
package and user-defined package.
There are many built-in packages such as java, lang, awt, javax,
swing, net, io, util, sql etc.
49. Advantages of Package
Java package is used to categorize the classes and interfaces so
that they can be easily maintained.
Java package provides access protection.
Java package removes naming collision
51. How to access package from
another package
There are three ways to access the package from outside the
package.
1. Using Package Name.*
2. import package.classname;
3. fully qualified name.
52. Using PackageName.*
//save by A.java
package pack;
public class A{
public void msg()
{
System.out.println("Hello");
}
}
//save by B.java
package mypack;
import pack.*;
class B
{
public static void main(String
args[])
{
A obj = new A();
obj.msg();
}
}
Output Hello
53. Using PackageName.ClassName
//save by A.java
package pack;
public class A{
public void msg()
{
System.out.println("Hello");
}
}
//save by B.java
package mypack;
import pack.A;
class B
{
public static void main(String
args[])
{
A obj = new A();
obj.msg();
}
}
54. Using FullyQualified Name
//save by A.java
package pack;
public class A{
public void msg()
{
System.out.println("Hello");
}
}
//save by B.java
package mypack;
class B
{
public static void main(String
args[])
{
pack.A obj = new pack.A();
//using fully qualified name
obj.msg();
}
}
55. Abstract and Interface
Abstract class and Interface both are used to achieve abstraction
where we can declared abstract and non-abstract method.
A class which is declared with abstract keyword is called
abstract class.
An Interface keyword is used to declare interface.
A class that implement interface must implement all the
methods declared in the interface.
56. Access Modifiers in Java
The access modifiers in java specifies accessibility (scope) of a
data member, method, constructor or class.
There are many non-access modifiers such as static, abstract etc.
57. default access modifier
If you don't use any modifier, it is treated as default by default.
The default modifier is accessible only within package.
package pack;
class A{
void msg()
{System.out.println("Hello");}
}
//save by A.java
package mypack;
import pack.*;
class B{
public static void main(String args[])
{
A obj = new A();//Compile Time Error
obj.msg();//Compile Time Error
}
}
//save by B.java
In this example, we have created two packages pack and mypack. the scope of class
A and its method msg() is default so it cannot be accessed from outside the package.
58. public access modifier
The public access modifier is accessible everywhere. It has the
widest scope among all other modifiers.
//save by A.java
package pack;
public class A{
public void msg()
{
System.out.println("Hello");
}
}
//save by B.java
package mypack;
import pack.*;
class B{
public static void main(String args[]){
A obj = new A();
obj.msg();
}
}
59. private access modifier
The private access modifier is accessible only within class.
class A
{
private int data=40;
private void msg()
{
System.out.println("Hello java");
}
}
public class Simple{
public static void main(String args[]){
A obj=new A();
System.out.println(obj.data);//Compile Time Error
obj.msg();//Compile Time Error
}
}
In this example, we have created two classes A
and Simple. A class contains private data
member and private method. We are accessing
these private members from outside the class,
so there is compile time error.
60. protected access modifier
The protected access modifier is accessible within package and outside the
package but through inheritance only.The protected access modifier can be
applied on the data member, method and constructor. It can't be applied on the
class.
In this example, we have created the two packages pack and mypack. The A class
of pack package is public, so can be accessed from outside the package. But msg
method of this package is declared as protected, so it can be accessed from
outside the class only through inheritance.
//save by A.java
package pack;
public class A{
protected void msg()
{System.out.println("Hello");}
}
//save by B.java
package mypack;
import pack.*;
class B extends A{
public static void main(String args[]){
B obj = new B();
obj.msg();
}
}
61. Java Array
Java array is an object that contains elements of similar data
type. It is a data structure where we store similar elements. We
can store only fixed set of elements in a java array.
Array can contains primitives data types as well as objects of a
class depending on the definition of array. In case of primitives
data types, the actual values are stored in contiguous memory
locations. In case of objects of a class, the actual objects are
stored in heap segment.
62. Advantage & Disadvantage of
Java Array
Advantage of Java Array :
1. Code Optimization : It makes the code optimized, we can retrieve
or sort the data easily.
2. Random access : We can get any data located at any index
position.
Disadvantage of Java Array :
1. Size Limit : We can store only fixed size of elements in the array. It
doesn't grow its size at runtime. To solve this problem, collection
framework is used in java.
63. Creating an Array in java
One-DimensionalArrays:
The general form of a one-dimensional array declaration is
type var-name[]; OR type[] var-name;
The element type for the array determines what type of data the
array will hold.
Like -- array of int type, we can also create an array of other
primitive data types like char, float, double..etc or user defined data
type(objects of a class).
// both are valid declarations ---
int intArray[]; or int[] intArray;
intArray is an array variable, no array actually exists. It simply
tells to the compiler that this(intArray) variable will hold an array of
the integer type. To link intArray with an actual, physical array of
integers, you must allocate one using new and assign it to intArray.
64. Instantiating an Array in Java
When an array is declared, only a reference of array is created. To
actually create or give memory to array, you create an array like this:
SYNTAX --- : var-name = new type [size];
// Here, type specifies the type of data being allocated, size specifies
the number of elements in the array, and var-name is the name of
array variable that is linked to the array.
65. Accessing Java Array Elements
The index begins with 0 and ends at (total array size)-1. All the
elements of array can be accessed using Java for Loop.
67. Jagged Array
Jagged Array are arrays of arrays with each element of the
array holding the reference of other array. These are also known
as multidimensional array. Examples: --
A multidimensional array is created by appending one set of
square brackets ([]) per dimension.
69. Array Literal
In a situation, where the size of the array and variables of array
are already known, array literals can be used.
The length of this array determines the length of the created
array.
There is no need to write the new int[] part in the latest versions
of Java.
71. Iterator interface
Iterator interface provides the facility of iterating the elements in forward
direction only.
Methods of Iterator interface :
No. Method Description
1 public boolean
hasNext()
It returns true if iterator has more elements.
2 public Object next() It returns the element and moves the cursor
pointer to the next element.
3 public void remove() It removes the last elements returned by the
iterator. It is rarely used.
72. Methods of Collection interface
.
No. Method Description
1 public boolean add(Object element) is used to insert an element in this collection.
2 public boolean addAll(Collection c) is used to insert the specified collection elements in the invoking collection.
3 public boolean remove(Object element) is used to delete an element from this collection.
4 public boolean removeAll(Collection c) is used to delete all the elements of specified collection from the invoking
collection.
5 public boolean retainAll(Collection c) is used to delete all the elements of invoking collection except the specified
collection.
6 public int size() return the total number of elements in the collection.
7 public void clear() removes the total no of element from the collection.
8 public boolean contains(Object element) is used to search an element.
9 public boolean containsAll(Collection c) is used to search the specified collection in this collection.
10 public Iterator iterator() returns an iterator.
11 public Object[] toArray() converts collection into array.
12 public boolean isEmpty() checks if collection is empty.
13 public boolean equals(Object element) matches two collection.
14 public int hashCode() returns the hashcode number for collection.
74. Collections in Java
Collection represents a single unit of objects i.e. a group.
Collections in java is a framework that provides an architecture
to store and manipulate the group of objects.
All the operations that you perform on a data such as searching,
sorting, insertion, manipulation, deletion etc. can be performed
by Java Collections.
Java Collection framework provides many interfaces (Set, List,
Queue, Deque etc.) and classes (ArrayList, Vector, LinkedList,
PriorityQueue, HashSet, LinkedHashSet, TreeSet etc).
75. What is framework in java :
1. provides readymade architecture.
2. represents set of classes and interface.
3. is optional.
What is Collection framework :
Collection framework represents a unified architecture for
storing and manipulating group of objects. It has:
1. Interfaces and its implementations i.e. classes
2. Algorithm
76. Two ways to iterate the elements of
collection in java
There are two ways to traverse collection elements:
1. By Iterator interface.
2. By for - each loop.
79. Java Non-generic Vs Generic Collection
Java collection framework was non-generic before JDK 1.5. Since 1.5, it
is generic.
Java new generic collection allows you to have only one type of object
in collection. Now it is type safe so typecasting is not required at run
time.
Let's see the old non-generic example of creating java collection.
ArrayList al=new ArrayList();
//creating old non-generic arraylist
Let's see the new generic example of creating java collection.
ArrayList<String> al=new ArrayList<String>();
//creating new generic arraylist
In generic collection, we specify the type in angular braces. Now
ArrayList is forced to have only specified type of objects in it. If you try
to add another type of object, it gives compile time error.
80. Type Casting
Assigning a value of one type to a variable of another
type is known as Type Casting.
82. Narrowing or Explicit type
conversion
When you are assigning a larger type value to a variable
of smaller type, then you need to perform explicit type
casting.
83. Exception and Exception handling
What is exception :
Exception is an abnormal condition.
In java, exception is an event that disrupts the normal flow of
the program. It is an object which is thrown at runtime.
What is exception handling :
The exception handling is a mechanism to handle the runtime
errors so that normal flow of the application can be maintained.
such as ClassNotFound, IO, SQL, Remote etc.
84. Types of Exception
There are mainly two types of exceptions:
checked
unchecked
where error is considered as unchecked exception.
The sun microsystem says there are three types of
exceptions:
Checked Exception
Unchecked Exception
Error
85. Checked Exception
The classes that extend Throwable class except
RuntimeException and Error are known as checked
exceptions .
Checked exceptions are checked at compile-time.
Example :
IOException, SQLException,
ClassNotFound Exception etc
86. Unchecked Exception
The classes that extend RuntimeException are known as
unchecked exceptions
Example :
ArithmeticException, NullPointerException,
NumberFormatException,
IndexOutOfBoundsException --
(
ArrayIndexOutOfBoundsException,
StringIndexOutOfBoundsException
) etc.
Unchecked exceptions are not checked at compile-time
rather they are checked at runtime.
87. Error
Error is irrecoverable .
Example :
StackOverFlowError, VirtualMachineError,
OutOfMemoryError, AssertionError, etc.
88. Common Scenarios Where
Unchecked Exception may occur
There are given some scenarios where unchecked
exceptions can occur.
They are as follows:
Scenario where ArithmeticException occurs
Scenario where NullPointerException occurs
Scenario where NumberFormatException occurs
Scenario where ArrayIndexOutOfBoundsException
occurs
Scenario where StringIndexOutOfBoundsException
occurs
89. ArithmeticException
If we divide any number by zero, there occurs an
ArithmeticException.
int a=50/0;//ArithmeticException
90. NullPointerException
If we have null value in any variable, performing any
operation by the variable occurs an
NullPointerException.
//NullPointerException
String s=null; System.out.println(s.length());
91. NumberFormatException
The wrong formatting of any value, may occur
NumberFormatException.
Suppose I have a string variable that have characters,
converting this variable into digit will occur
NumberFormatException.
String s="abc";
int i=Integer.parseInt(s);//NumberFormatException
92. ArrayIndexOutOfBoundsException
If you are inserting any value in the wrong index, it
would result ArrayIndexOutOfBoundsException as shown
below:
int a[]=new int[5];
a[10]=50; //ArrayIndexOutOfBoundsException
93. StringIndexOutOfBoundException
This exception is thrown by the methods of the String class, in
order to indicate that an index is either negative, or greater than
the size of the string itself. Moreover, some methods of
the String class thrown this exception, when the specified index
is equal to the size of the string.
94. Common Scenarios Where
checked Exception may occur
Scenario where IOException occurs
Scenario where SQLException occurs
Scenario where ClassNotFound Exception occurs
95. IOException
IOException is the general class of exceptions produced by
failed or interrupted I/O Operations.
As This is the checked Exception, It must be handled by the
programmer else program does not compile.
Below are some scenarios when IOException would be
thrown.
You were reading network file and got disconnected.
Reading Local file which is not available any more.
Using some stream to read the data and some other process
closes the stream.
You are trying to read/write a file and don’t have permission
You were writing a file and disk space is not available
anymore