PL/SQL – Part 5

FUNCTIONS Structure for creating function: Ex: Create Function: Execute Function: Wrong Method Execute Function: Method 1 Execute Function: Method 2 Execute Function: Method 3 Ex:1 Ex:2 A function returns more than a single value, we can use an approach such as returning a record (also known as a row) or a collection. (collection will seeContinue reading “PL/SQL – Part 5”

WRAPPER CLASS IN JAVA

WRAPPER CLASS: Java is an Object oriented programming language. So represent everything in the form of Objects. But java supports 8 – primitive data types, these are not objects. To represent 8 – primitive data types in the form of object, we required 8 java classes, these classes are called WRAPPER CLASS. So, Wrapper classContinue reading “WRAPPER CLASS IN JAVA”

LAMBDA EXPRESSIONS & FUNCTIONAL INTERFACE

Java – It supports OOPs & FP paradigm. Based on oops, Everything in java are objects, except primitive data types. We need object references to call any method. In Functional Programming, Purpose: Concise coding Do not need object creations. LAMBDA EXPRESSIONS: Lambda expression is a new feature which is introduced in Java 8. A lambdaContinue reading “LAMBDA EXPRESSIONS & FUNCTIONAL INTERFACE”

STRING METHODS

length( ) Length method is used to find total count of element in String. Output: India 5TamilNadu 9Tenkasi 7 isBlank( ) & isEmpty( ) If any method starts with is, then the method return data type is boolean. It returns true or false only. isBlank( ) return true: Inside the double quotation, Spaces are presentContinue reading “STRING METHODS”

TYPE CASTING IN JAVA

TYPE CASTING: Type casting is a way of converting data from one data type to another data type. This process of data conversion is also known as type conversion. Types: Widening or Implicit Up Casting Narrowing or Explicit down Casting Type casting is applicable for both primitive & non primitive data types. TYPE CASTING FORContinue reading “TYPE CASTING IN JAVA”

Who is winner in running competition? Players name in String array & Their running seconds in Integer array are given.

Output: Players Name & their running secondsGowsy – 50 secondsMehra – 40 secondsGokii – 25 secondsManju – 30 secondsLakshmi – 90 secondsNandhini – 75 seconds Winner:Gokii – 25 seconds First Runner Up:Manju – 30 seconds Second Runner Up:Mehra – 40 seconds

MATRIX IN JAVA

MATRIX ADDITION: Ex 1: Thinking level 1: Output: 10 12 1418 20 2220 12 24 Thinking level 2: Output: 10 12 1418 20 2220 12 24 Thinking level 3: final Output: 10 12 1418 20 2220 12 24 Ex 2: Using Scanner Class Output: Enter array size2Enter array1 value22334455Enter array2 value11213141Sum of array1 & array233Continue reading “MATRIX IN JAVA”

Basics – Two Dimensional Array in Java

INTRO: Click ARRAY to learn about that. A 2D array is an array of one-dimensional arrays. 2D array is a collection of data cells. 2D array is stored in the form of rows and columns and is represented in the form of a matrix. We can access it by row index and column index (likeContinue reading “Basics – Two Dimensional Array in Java”

BINARY SEARCH IN JAVA

BINARY SEARCH: Binary Search is one of the fastest searching algorithms. It is used for finding the location of an element in a linear array. It works on the principle of divide and conquer [கைப்பற்றும்] technique. Binary Search Algorithm can be applied only on Sorted arrays. To apply binary search on an unsorted array, First,Continue reading “BINARY SEARCH IN JAVA”

BUBBLE SORT IN JAVA

SORTING: Sorting is the process of arranging the elements of an array So that they can be placed in ascending or descending order. BUBBLE SORT: Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison-based algorithm in which each pair of adjacent elements is compared and elements are swapped if they are notContinue reading “BUBBLE SORT IN JAVA”

DATA TYPES IN JAVA

What is data type? To store the data, we must allocate the space. Using data type, we can allocate the space. Data type defines the size and values that can be stored in the variable. Types: PRIMITIVE DATA TYPE Primitive data type is pre-defined by the programming language. There are 8 primitive data types suchContinue reading “DATA TYPES IN JAVA”

ARRAYS BASICS

ARRAYS: An array is a collection of similar data types. [Datatype -> Primitive & Non primitive] [We can create array for object class. Above line is not suitable for that. Will learn later about that]. Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value. VariableContinue reading “ARRAYS BASICS”

toString( )

If we are trying to print the object, println method automatically called the toString method. toString( ) method is predefined method inside the Object class. Object class is the parent class of every class. toString( ) method returns String representation of hash code. packageName.className@hexaDecimalValueOfHashcode. Ex 1: OUTPUT: Print Sample Class Object1: SelfLearn.Sample@c2e1f26Print Sample Class Object2:Continue reading “toString( )”

HASHCODE

What is hashcode? hashCode method which is available in Object Class (In java, Object class is the parent class of every class). hashCode method returns unique integer for every objects. i.e., Human have unique aadhar number, Every object have unique hash code. hashCode method calling syntax: objectName.hashCode( ); Ex 1: Output: Print Hashcode for SampleContinue reading “HASHCODE”

Can we override static method?

Method Overriding: If the same method name is declared in both the superclass and the subclass, then the method of the sub class overrides the method of the superclass. This is known as method overriding. Ex 1: Output: Early Morning Study – Best Ex 2: Output: Group Study – Best Code Explanation: In Ex 1,Continue reading “Can we override static method?”

Private Constructor

PRIVATE CONSTRUCTOR: Private constructor is useful for restrict an object creation from outer class. Ex: If a class contain zero argument constructor as private, we can create zero argument object within the class. we can’t create zero argument object for that class from outside class. Ex 1: Without private constructor Output: Program1 – Constructor ExContinue reading “Private Constructor”

TeleApps Interview Qns – JAVA

1] Can We Overload main() method? A. Yes we can B. No we can’t ANSWER: A.YES WE CAN OUTPUT: We can overload the main method30SRajalakshmi 2] What is the output? A) -4,4B) -3,3C) -2,2D) -1,1 ANSWER: D) -1, 1 3] What is the output? A) 1020Hello Hello1020B) 30Hello Hello30C) 30Hello Hello1020D) 1020Hello Hello30 ANSWER: C)Continue reading “TeleApps Interview Qns – JAVA”

LINEAR SEARCHING – ARRAY

What is searching? Searching is a process of finding a particular element among several given elements. The search is successful if the required element is found. Otherwise, the search is unsuccessful. Searching types: LINEAR SEARCH: Linear Search is the simplest searching algorithm. It searches the element by comparing it with each element of the arrayContinue reading “LINEAR SEARCHING – ARRAY”

Basics – Scanner, System.in, System.out.println()

SCANNER CLASS: Scanner class is used to get input from user. Scanner is a predefined class in java Scanner is a final class. We can’t inherited Scanner class. Import the scanner class: Scanner class presented in java.util package. We want to import the package, before using the scanner class. Create Scanner Object: Here, Scanner isContinue reading “Basics – Scanner, System.in, System.out.println()”

For looping in java

Syntax: Explanation: For loop is another way of while loop. For loop process: Initialize the value (A) Check the condition (B) Print the statement (D) Increment or Decrement the value (C) Check the condition (B) Print the statement (D) Steps 4, 5, 6 are repeated. When the condition (B) is false, loop will be terminated.Continue reading “For looping in java”

ADAM NUMBER IN JAVA

Adam Number: Consider a number = 12. Reverse of a number = 21. Square of a number (12) = 144. Square of Reverse of number (21) = 441. Square of 12 & the square of its reverse 21 are reverse of each other. Therefore 12 is an adam number. STEPS: Initialize number(12) Find reverse ofContinue reading “ADAM NUMBER IN JAVA”

Basics of software testing

What is software? Software is a set of instructions or programs written by programmers/developers on various languages for machine to perform some specific task. What is software testing? Software Testing ensures that the developed software meets the customer expectations. The main purpose of software testing is to identify errors, missing requirements, and technical issues. WeContinue reading “Basics of software testing”

BASICS OF HTML

HTML: HYPER TEXT MARKUP LANGUAGE It is used for designing web pages. We can understand this language easily. Html consists of tags. By using tags we can design the web page. Basic Structure: NOTE: Save the file with extension name .html IMPORTANT NOTES: <!DOCTYPE html> This line denote “This is html version 5”. This lineContinue reading “BASICS OF HTML”

BASICS OF SQL

DATABASE: [DB] Used for storing the data. Variables are also data storage. But variables are temporary data storage. Database are permanent data storage. Database storing the data in the structure of TABLE (ROWS & COLUMNS). Rows are known as RECORDS Columns are known as FIELDS RDBMS: RELATIONAL DATABASE MANAGEMENT SYSTEM Relationship between data are knownContinue reading “BASICS OF SQL”

BASICS OF GIT

GIT: Git is a free and open-source distributed version control system. GIT is used for: Tracking code changes Tracking who made changes Coding collaboration with others WHO CREATED GIT? LINUS TROVALDUS He is responsible for the linux kernel. GITHUB: Github is a website/platform while git is a tool. Instagram:Camera :: Github:Git Git or Camera isContinue reading “BASICS OF GIT”

Basic – Object, Class, Method & Variable

What is object? Real world entity. It is instance of a class. It is memory reference of a class. It is a combination of state & behavior. State denotes Instance Variable. Behavior denotes Instance Methods. We can access these instance variable & instance methods by using object name. Using new keyword, we create an object.Continue reading “Basic – Object, Class, Method & Variable”

OPERATORS IN JAVA

Operators: It is a symbol that is used to perform operations. Types: Arithmetic Operator Unary Operator Assignment Operator Relational Operator Logical Operator Ternary Operator Bit-wise Operator Shift Operator ARITHMETIC OPERATORS: They are used to perform simple arithmetic operations. * : Multiplication / : Division % : Modulo + : Addition – : Subtraction Ex: ArithmeticContinue reading “OPERATORS IN JAVA”

INCREMENT & DECREMENT OPERATORS

INCREMENT OPERATORS It is used to incrementing the value 1. It have two types. Pre-Increment Operator Post-Increment Operator Pre-Increment Operator: Ex: ++a Before the variable, ++ is placed. Value is incremented first & then result is computed (Processed/Printed). Post-Increment Operator: Ex: a++ After the variable, ++ is placed. Value is computed first & then valueContinue reading “INCREMENT & DECREMENT OPERATORS”

While loop practice- Modulo & Divider

Scenario 1: while(purse>0) Output: 654321No of Digits: 6 Code Explanation: In while condition, we declare purse is greater than zero. So, purse gets executed till 1. Scenario 2: while(purse>1) Output: 65432No of Digits: 5 Code Explanation: In while condition, we declare purse is greater than one. So, purse gets executed till 2. Scenario 3: [System.out.println(purse%100);]Continue reading “While loop practice- Modulo & Divider”

CAN WE USE SWITCH STATEMENTS WITH STRING

Strings in switch: Beginning with JDK 7, we can use a string to control a switch statement, which is not possible in C/C++. Ex 1: Output: two Ex 2: Output: No of Month: 10 Ex 3: Same program – cases in same line: Output: This is boys name Ex 4: Output: Working Day Ex 5:Continue reading “CAN WE USE SWITCH STATEMENTS WITH STRING”

SWITCH CASE STATEMENT

Switch Case Statement: Switch statement executes one statement from multiple conditions. It is like if-else-if ladder. The switch statement works with byte, short, int, long, enum types, String and some wrapper types like Byte, Short, Int, and Long (Datatype learn later). Syntax: break is optional. We can have any number of case statements Last oneContinue reading “SWITCH CASE STATEMENT”

DO WHILE LOOP IN JAVA

Do – While Loop: It is an exit control loop. The do-while check the condition at the end of loop body. The do-while loop is executed at least once because condition is checked after loop body. Syntax: Ex 1: Output: 10 Code Explanation: if a is above or equal to 100, then print a value.Continue reading “DO WHILE LOOP IN JAVA”

If else statements without curly braces

It is also correct without braces, if there is only one statement under the if / else condition. but if you have to put multiple statement under the if / else condition then you must provide braces, without braces if / else condition will only read first statement and output will be different from asContinue reading “If else statements without curly braces”

GETTER & SETTER METHODS

Getter and Setter methods are used to protect the data and make the code more secure. private variables can access within the same class. An outside class can’t access the private variable. Using get & set methods, we can access the other class private variables. Get method returns the variable value Set method sets theContinue reading “GETTER & SETTER METHODS”

INTERFACE IN JAVA

Interface: Interface is a blueprint of a class. In other words, It is set of rules or contract. Interface Declaration: An interface is declared by using the interface keyword. Syntax: Interfaces have the following properties: An interface is implicitly abstract. do not need to use the abstract keyword while declaring an interface. Each method inContinue reading “INTERFACE IN JAVA”

WHILE LOOP IN JAVA

While loop: Syntax: While loop is used to repeatedly execute the code in between the braces as long as the specified condition is met. While loop is considered as repeating if statement. It saves time, reduce the code & error. Ex 1: 5 times Print the name “Rajalakshmi” Output: RajalakshmiRajalakshmiRajalakshmiRajalakshmiRajalakshmi Note: Program 9th line DoContinue reading “WHILE LOOP IN JAVA”

ASSESSMENT – 1

Scenario #1:Expected Understanding: Access Modifiers, Single Inheritance, getter methods, Constructor Overloading 1) Create a Class named “Trainer”.– Have default instance variables String dept, institute– Have private instance variable int salary– Assign 10000 as value for salary.– Create getter method for salary.– Assign values – “Java”, “Payilagam” to them– Have instance method training() with void asContinue reading “ASSESSMENT – 1”

Java If-else Statement

If-else statements are defined as Control Statements which controls the statements to be executed on the basis of some condition. 4 types are there. if statement nested if statement if-else statement if-else-if statement IF STATEMENT: Java if statement tests the condition. It executes the if block, if condition is true. Syntax: Ex:1 Output: a isContinue reading “Java If-else Statement”

Abstraction in java

Abstraction: The process of showing only essential things & hiding the background details / inner details. Ex: We can handle TV, Washing machine, AC, Vehicles & ATM card yet we don’t have the knowledge of their inner operations. Abstract Class: A class which contains the abstract keyword in its declaration is known as abstract class.Continue reading “Abstraction in java”

super( ) keyword in java

super( ): super( ) keyword is used to calling a super class constructor from the sub class constructor. super( ) super –> it denotes super class constructor ( ) we can give super class constructor’s input or sub class constructor’s parameter inside this brackets. (Refer below scenario) Parent class constructors are called by this bracketContinue reading “super( ) keyword in java”

this( ) keyword in java

this( ): this( ) keyword is used to calling a current class constructor from the current class another constructor. this( ) this –> it denotes current class constructor ( ) we can give nothing or constructor’s input inside this brackets. Current class constructors are called by this bracket content. this( ) –> zero argument constructorContinue reading “this( ) keyword in java”

METHOD OVERRIDING & DYNAMIC BINDING IN JAVA

What is method overriding? If the same method name is declared in both the superclass and the subclass, then the method of the sub class overrides the method of the superclass. This is known as method overriding. Overriding Rule: It required atleast two classes. They must be IS-A relationship.(Inheritance) Both the superclass and the subclassContinue reading “METHOD OVERRIDING & DYNAMIC BINDING IN JAVA”

INHERITANCE

WHAT IS INHERITANCE? An object of one class behaving as an object of another class is known as inheritance. In java, a class can inherit all the properties & behaviors of another class. The class which inherits from other class properties is known as child class, sub class, derived class. The class whose properties areContinue reading “INHERITANCE”

Constructor in Java

CONSTRUCTOR: Constructor is a special method. It is used for initializing an object variables. It is called automatically when we create an object or when the class is initialized. Constructor cannot be static When a method as static, it means the method belongs to the class and not to a specific object. But the constructorContinue reading “Constructor in Java”

Default Access Modifier in Java:

Package: Packages are folder structure. Packages as the name suggests, is for packing related classes into one group. we write at the beginning of any class file to indicate where exactly that class has to be created. It helps organize our classes into a folder structure and make it easy to locate and use them.Continue reading “Default Access Modifier in Java:”

Basic Concept from Object Oriented Analysis & Design

Modularity: In modular programming, the code is divided into different ‘modules’ which are responsible for a particular functionality in the entire project. This helps in development, debugging and maintenance of the code. Typically, modules should be as independent of each other as possible, where independence means that changes to a module leads to minimal changeContinue reading “Basic Concept from Object Oriented Analysis & Design”

Static & Non Static Block in java

Statement : Statement is a complete unit of execution. Block: A block is a group of statements (zero or more) that is enclosed in curly braces { }. Diff b/w method & block: METHOD BLOCK A method is set of instructions grouped together to perform specified task in the class Block is a group ofContinue reading “Static & Non Static Block in java”

Anonymous Object in Java

Anonymous Object: Anonymous meaning not identified by name / nameless. An object which has no reference variable is called anonymous object in Java. If you want to create only one object in a class then the anonymous object is a good approach. Syntax: If you want to call a method through the anonymous object thenContinue reading “Anonymous Object in Java”

Private & Public Access Modifiers

Access Modifiers: The access modifiers in Java specifies the accessibility or scope of a variable, method, constructor, or class. We can change the access level of variables, constructors, methods, and class by applying the access modifier on it. There are four types of Java access modifiers: private public default protected Private: The access level ofContinue reading “Private & Public Access Modifiers”

OOPs Basic Concept :

Programming: Programming is a way of giving instructions to computer about what they should do next. These instructions are known as code & programmers write the code to solve the problems or perform a task. So, we can control the machine by programming. Trial & Error is possible in programming. Paradigm: Paradigm means Idea. SomeContinue reading “OOPs Basic Concept :”

Design a site like this with WordPress.com
Get started