27.2 C
Bacolod City
Tuesday, August 20, 2019
Home Authors Posts by lokssharma99

lokssharma99

23 POSTS 1 COMMENTS
JDBC INSERT Statement,Difference between String Buffer and String Builder,Difference between String class and String Buffer/ String Builder class in Java,Final Object in Java,How to avoid class cast Exception in Java,Main Method Overriding in Java,How to Read a Plain Text File in Java,How to Write to a File or a Plain Text Document,Throw Keyword in JAVA (User Defined Exception),Concat() Method of String class in Java,Thread States / Thread Life Cycle in Java,Method Overriding in Java,Wrapper Classes in Java,Final Keyword in Java,Basic Concepts of Java,Basic Data types,Serialization in Java,Loop Control,Scanner Class in Java,Java Assertion,How to get current date and time of the system in Java, Encapsulation,Abstraction,Overriding,Exception Handling in Java,The Collection Classes,Java ArrayList,Finalize Method in java,Console class in Java

Encapsulation

Encapsulation In Java data encapsulation is concerned with: Combining data and how it's manipulated in one place. Only allowing the state of an object to be accessed and modified through behaviors. Hiding the details of how the object works. Example: public class Vegetable { private String name; private String price; private String taste; private Vegetable(String name, String price, String taste) { this.name...
JDBC INSERT Statement,Difference between String Buffer and String Builder,Difference between String class and String Buffer/ String Builder class in Java,Final Object in Java,How to avoid class cast Exception in Java,Main Method Overriding in Java,How to Read a Plain Text File in Java,How to Write to a File or a Plain Text Document,Throw Keyword in JAVA (User Defined Exception),Concat() Method of String class in Java,Thread States / Thread Life Cycle in Java,Method Overriding in Java,Wrapper Classes in Java,Final Keyword in Java,Basic Concepts of Java,Basic Data types,Serialization in Java,Loop Control,Scanner Class in Java,Java Assertion,How to get current date and time of the system in Java, Encapsulation,Abstraction,Overriding,Exception Handling in Java,The Collection Classes,Java ArrayList,Finalize Method in java,Console class in Java

Abstraction

Abstraction Abstraction in Java is used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object (interface). An abstract class contains an abstract keyword. An abstract class can or cannot have abstract methods. A method that...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Polymorphism

Polymorphism The word 'polymorphism’ literally means 'the capacity to take on different forms'. When applied to object oriented programming language like Java, it describes a language's ability to process objects of various types and classes through a single interface. Example: public interface Small{} public class House{} public class Room extends House implements Small{} Room class...
JDBC INSERT Statement,Difference between String Buffer and String Builder,Difference between String class and String Buffer/ String Builder class in Java,Final Object in Java,How to avoid class cast Exception in Java,Main Method Overriding in Java,How to Read a Plain Text File in Java,How to Write to a File or a Plain Text Document,Throw Keyword in JAVA (User Defined Exception),Concat() Method of String class in Java,Thread States / Thread Life Cycle in Java,Method Overriding in Java,Wrapper Classes in Java,Final Keyword in Java,Basic Concepts of Java,Basic Data types,Serialization in Java,Loop Control,Scanner Class in Java,Java Assertion,How to get current date and time of the system in Java, Encapsulation,Abstraction,Overriding,Exception Handling in Java,The Collection Classes,Java ArrayList,Finalize Method in java,Console class in Java

Overriding

Overriding If the child class has the same method as the parent class we call it method overriding in java. Example: class House { void display() { System.out.println(“House”); } } class Room extends House { void display() { System.out.println(“Room”); } } class Basic { public static void main(String args) { House h=new House(); House o=new Room(); h.display(); o.display(); } } Output: House Room Rules for Java Method Overriding 1.method must have same name as in the parent class. 2.method must...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Inheritance

INHERITANCE Inheritance is one of the key features of Java. Inheritance basic use is that it allows a class to inherit property of another class. When a Class extends another class it inherits all non-private members including fields and methods. Inheritance in Java is usually understood in terms of Parent...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Inner Classes

Java Inner Class Java inner class can be called as nested class i.e. declared inside the class or interface. We use inner classes to group classes and interfaces in one place so that it can be more readable,understandable and maintainable. It also allows access to all the members of outer class including...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Exceptions

Exception Handling in Java The exception handling in java is a mechanism to handle the runtime errors, that occurs a lot for a beginner, so that actual programme of the application can be maintained. We will learn about java exception, its type and the basic difference between checked and unchecked exceptions. Exception? In...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Files and Java I/O

Java I/O Tutorial Java I/O (Input and Output) is used to take the input and give the output depending on the input. Java has its own term stream in order to fetch I/O operation faster. The java.io package consists of all the classes required to have an input and output operations. We...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Regular Expressions

Regular expressions Java Regex The Java Regex serves as an API to define pattern for searching strings. It is used to define constraint on a given strings like password validation or for email validation. After going through this java regex tutorial, you can test your own regular expressions!! java.util.regex package It provides classes and...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Date and Time

Date and time To access date and time ,we need java.util package.We cannot display a Date object without first converting it to a String. The class java.util.Date represents a specific instance in time. It has two constructors: S.no. Constructor Description 1. Date() Allocate a Date instance with the current time. 2. Date(long millisec) This...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Methods

Methods A method is some number of statements written together which can be called at any point by the method’s name. Defining Methods public double method_name(double a ,int b) { //body } public:Modifier double: Return type double a ,int b:Parameter list Example: public double sum(double a ,int b) { double s=a+b; return s; } Calling a Method: public class ExamSum { public static void main(String args) { double a...
CSS Introduction,CSS Selector,CSS Internal,CSS External,CSS Links,06-CSS Class,05-CSS Inline

07-CSS Links

A person can style the links using CSS . Links can be designed depending on their states: a:link- normal ,unvisited link by the user a:visited- link by the user a:hover- a link which changes it color when the user takes the mouse over it. a:active- a link which shows it...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Arrays

Arrays Arrays can be thought of as homogeneous collection of variables of same type. Arrays are index based. The first index is 0,next 1 and so on till desired.We can have desired values in the desired index.While declaring arrays we need to specify the data type and name of the...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Strings

Strings Strings are a sequence of characters.In java,string is basically an object. Example: String tutorial=”Java”; String objects can be created by using new keyword and a constructor. Example String str1=”Fan”; String str2="Fan"; String str3=new String("Fan") //Using constructor. If(str1 == str2) System.out.println("both are same"); Else System.out.println(" both are not same "); If(str1 == str3) System.out.println("not similar"); Else System.out.println("I am using constructor here"); If( str1.equals(str3) ) System.out.println("similar"); Else System.out.println("Not similar"); The output...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Characters

This Java Tutorial is all about Characters. Characters Most of the time when we work with single character value we use primitive type char. Example: Char x=’Z’; However ,sometimes we need to use a char as an object.For this purpose Java provides us wrapper class that wraps char to Character object.A Character object can...
Polymorphism in Java,Basic Operators,Modifier Type,Decision Making,Numbers,Java Inner Classes,polymorphism,Inheritance,Exceptions,Files and Java I/O,Regular Expressions,Date and Time,Methods,Arrays,Strings,Characters

Numbers

Numbers When we work with numbers most of the time it is that we work with primitive data types. Example: int x=7347; double y=6.8879; However sometimes it occurs that a user cant use these data types so in that case. A user can use objects through the wrapper classes. Actually what does the wrapper...

Follow us on Facebook

SuperWebTricks Loading...

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!