CampusPreparation and Learn coding for software professional
Nearby schools & colleges
Mayurbhanj
751019
751001
Odisha
751001
751001
751024
N3/65, Near ekamra kanan
751012
Cttc
Dhenkanal
Cspur
You may also like
C, C++,Java8, Oracle, MySQL, Spring,Microservice, Lambada Expression,Angular,Java Script,RestAPI
Java 8 new features
1.Functional Interface
2.Single Abstract Method
3. Lambda expression
4.java. Time util package
5. Steam API
1. Functional Interface is a interface which is having one abstract method
Ex:- Runnable, Comparator
// JAVA Code for Find Second largest
// element in an array
class GFG {
/* Function to print the second largest
elements */
public static void print2largest(int arr[],
int arr_size)
{
int i, first, second;
/* There should be atleast two elements */
if (arr_size < 2) {
System.out.print(" Invalid Input ");
return;
}
first = second = Integer.MIN_VALUE;
for (i = 0; i < arr_size; i++) {
/* If current element is greater than
first then update both first and second */
if (arr[i] > first) {
second = first;
first = arr[i];
}
/* If arr[i] is in between first and
second then update second */
else if (arr[i] > second && arr[i] != first)
second = arr[i];
}
if (second == Integer.MIN_VALUE)
System.out.print("There is no second largest"
+ " element\n");
else
System.out.print("The second largest element"
+ " is " + second);
}
/* Driver program to test above function */
public static void main(String[] args)
{
int arr[] = { 12, 35, 1, 10, 34, 1 };
int n = arr.length;
print2largest(arr, n);
}
}
// JAVA Code for Find Second largest
// element in an array
class SecondLargest{
/* Function to print the second largest
elements */
public static void print2largest(int arr[],
int arr_size)
{
int i, first, second;
/* There should be atleast two elements */
if (arr_size < 2) {
System.out.print(" Invalid Input ");
return;
}
first = second = Integer.MIN_VALUE;
for (i = 0; i < arr_size; i++) {
/* If current element is greater than
first then update both first and second */
if (arr[i] > first) {
second = first;
first = arr[i];
}
/* If arr[i] is in between first and
second then update second */
else if (arr[i] > second && arr[i] != first)
second = arr[i];
}
if (second == Integer.MIN_VALUE)
System.out.print("There is no second largest"
+ " element\n");
else
System.out.print("The second largest element"
+ " is " + second);
}
/* Driver program to test above function */
public static void main(String[] args)
{
int arr[] = { 12, 35, 1, 10, 34, 1 };
int n = arr.length;
print2largest(arr, n);
}
}
Find the second largest element in a single traversal.
1) Initialize the first as 0(i.e, index of arr[0] element
2) Start traversing the array from array[1],
a) If the current element in array say arr[i] is greater
than first. Then update first and second as,
second = first
first = arr[i]
b) If the current element is in between first and second,
then update second to store the value of current variable as
second = arr[i]
3) Return the value stored in second.🙂
Dependency injection in spring defines dependency between 2 class is through constructor and not creating of one class object inside another class.In that case lowcoupling can achieve and testing is easy and code is maintainable
== check 2 datas are same or not
=== checks datas along with datatypes,so it is called strict equal type.
In Javascript var is used for variable declaration.ECMA6 script another 2 added that is let and const.
var declaration is for function scope.
let is for block scope. const is for constant declaration
RDBMS
DDL commands are create, alter, truncate, drop.
DML commands are insert, delete, update
DCL commands are select
TCL commands are commit, rollback
int i=5;
printf("%d %d %d",i++,i, ++i );
output is 677
Javascript is a weak type language means you can declare a variable without data type like example
var a
a=12
here a is automatically treated as integer but in other java you can declare it as int.
So java is a strong type object oriented language.
Self join is a join in SQL when you are querying with same table as alias
Click here to claim your Sponsored Listing.
Category
Contact the school
Telephone
Website
Address
Bhubaneswar
4th Floor(North West), OCAC Tower, Plot No-N-1/7D, Acharya Vihar
Bhubaneswar, 751013
Reseapro Scientific Services (P) Limited is a leading research service based company specializing in
Rasulgarh
Bhubaneswar, 751022
We Provide the Qualified and Trained Teachers of one of the best Teacher Training institute in India
Mayurbhanj
Bhubaneswar, 757034
Hello friends ,Welcome to my page EK EDUCATION ODISHA .Here you can watch education,current events and life related information which will be helpful for healthy living .Stay conne...
Bhubaneswar
sure Success a education institute at Bhubaneswar that provides curses like B.Ed , B.P.Ed , B.H.Ed ,
HIG/18
Bhubaneswar, 751013
The objective of forming this community is to empower and equip the entire student fraternity with essential skills set, positive image building, and influential and persuasive mor...