This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.manjay; | |
public class duplicate_element { | |
public static void main(String[] args) { | |
// String arr = new String[]{ } ; | |
String[] arr = new String[]{"b","a","a","a"}; | |
System.out.println("Duplicate elements in given array: "); | |
//Searches for duplicate element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.manjay; | |
import java.util.Scanner; | |
public class inputarray { | |
public static void main(String[] args) { | |
System.out.println("Enter numbers of element"); | |
Scanner sc = new Scanner(System.in); | |
int num = sc.nextInt(); | |
int[] arr = new int[num]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package oops; | |
//import javax.security.auth.Subject; | |
public class oops { | |
public static void main(String[] args) { | |
//System.out.println("Person Name and Age"); | |
{ //college name | |
college c = new college(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class ArrayList2 { | |
public static void main(String[] args) { | |
ArrayList<String> arrayList =new ArrayList<>(); | |
System.out.println("Intial size of arraylist"+ arrayList.size()); | |
arrayList.add("A"); | |
arrayList.add("B"); | |
arrayList.add("C"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class LinkList { | |
public static void main(String[] args) { | |
// Creating a LinkedList | |
LinkedList<String> friends = new LinkedList<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package data.structure.java; | |
class person{ | |
private String name; | |
private String noOfVehicle; | |
private String vehicle1; | |
private String Vehicle2; | |
void setPersonDetails(String newName,String noOfVehicle,String vehicle1,String vehicle2){ | |
this.name=newName; | |
this.noOfVehicle=noOfVehicle; | |
this.vehicle1=vehicle1; |