Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Devindi Jayathilaka devindianushika

🎯
Focusing
  • University Of Moratuwa Faculty Of Information Technology
  • Sri lanka
View GitHub Profile
@devindianushika
devindianushika / First.java
Last active Jun 17, 2019
SpringbootFirst
View First.java
package com.audelia.springdemo.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/end")
View Domain.java
package com.audelia.first.Domain;
import javax.persistence.*;
@Entity
@Table(name = "user")
public class UserDTO {
View UserRepository.java
package com.audelia.first.Repositories;
import com.audelia.first.Domain.UserDTO;
import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository<UserDTO,Integer> {
}
View IsaRelationship.java
class Parent{
public void m1() {
System.out.println("parent");
}
}
class Child extends Parent{
public void m2(){
System.out.println("child");
}
View Circle.java
package com.poly.overriding;
public class Circle implements Shape{
@Override
public void draw(){
System.out.println("Drwaing circle");
}
View Shape.java
package com.poly.overriding;
public interface Shape {
public void draw();
}
View Square.java
package com.poly.overriding;
public class Square implements Shape {
@Override
public void draw() {
System.out.println("Drawing Square");
}
View NewCircle.java
package com.poly.overloading;
public class NewCircle {
public void draw(){
System.out.println("circle with default color Black and diameter 1 cm.");
}
public void draw(int diameter){
System.out.println("circle with default color Black and diameter"+diameter+"cm.");
}
public void draw(int diameter, String color){
@devindianushika
devindianushika / controler.java
Last active Nov 17, 2019
Add rest controllers
View controler.java
package com.audelia.first.controlers;
import com.audelia.first.Domain.UserDTO;
import com.audelia.first.Services.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
View UserServices.java
package com.audelia.first.Services;
import com.audelia.first.Domain.UserDTO;
import java.util.List;
public interface UserServices {
List<UserDTO> findAllUsers();