Posts

Showing posts from January, 2024

What are Basic concepts of Java ?

Main Basic concept of Java. Jdk JRE Compiler package Interpreter Datatypes. conditional statement looping statement Keywords new this super final static Oops Concept Class Object Encapsulation Polymorphism Inheritance Abtraction Exception Handling try catch finally throw throws Collection Frameworks List Arraylist LinkedList Vector Set hashset treeset linkedset Map Hashmap treemap

Crud Operation API calling Using Postman

 package com.example.task.demo; import java.util.ArrayList; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @RestController public class StudentController { ArrayList<Student>aa=new ArrayList<Student>(); /* Using Constuctor*/  public StudentController(){ aa.add(new Student(401, "Ganesh")); aa.add(new Student(402, "Shreyash")); aa.add(new Student(401, "Aniket")); aa.add(new Student(401, "Darshan")); } @GetMapping("all") public ArrayList<Student> All(){ return aa; } @GetMapping("singleRecord/{id}") // requestapi // 101 public Student singleRecord(@PathVariabl...

Angular Simple Routing

  app.routing.module.ts onst routes : Routes = [{   component : HomeComponent ,   path : 'home' }, {   component : UserComponent ,   path : 'user' }, {   component : UserComponent ,   path : 'about' } app.component.html < a routerLink = " " > Home </ a >< br > < a routerLink = "about" > About </ a >< br > < a routerLink = "user" > User </ a >< br > < router-outlet ></ router-outlet >

Difference Between Iterator vs ListIterator?

An Iterator is an interface in Java and we can traverse the elements of a list in a forward direction whereas a ListIterator is an interface that extends the Iterator interface and we can traverse the elements in both forward and backward directions. An Iterator can be used in these collection types like List, Set, and Queue whereas ListIterator can be used in List collection only. The important methods of Iterator interface are hasNext(), next() and remove() whereas important methods of ListIterator interface are add(), hasNext(), hasPrevious() and remove(). Syntax Of Iterator:- public interface Iterator < E > Example:- import java . util . * ; public class IteratorTest { public static void main ( String [ ] args ) { List < String > listObject = new ArrayList < String > ( ) ; listObject . add ( "India" ) ; listObject . add ( "Australia" ) ; listObject . add ( "England" ) ; listObjec...