Recursion hell
This commit is contained in:
14
Semester 3/mavenproject1/pom.xml
Normal file
14
Semester 3/mavenproject1/pom.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>edu.slcc.asdv.caleb</groupId>
|
||||
<artifactId>mavenproject1</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<exec.mainClass>edu.slcc.asdv.caleb.mavenproject1.Mavenproject1</exec.mainClass>
|
||||
</properties>
|
||||
</project>
|
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package edu.slcc.asdv.caleb.mavenproject1;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class GenericsTest {
|
||||
public static int f3(ArrayList<? extends Number> list) {
|
||||
return 1;
|
||||
}
|
||||
public static int f1(ArrayList<Number> list) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void f2(Number n) {
|
||||
|
||||
}
|
||||
void f5() {
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
ArrayList<Integer> l1 = new ArrayList<Integer>();
|
||||
f3(l1);
|
||||
Integer i = 10;
|
||||
f2(i);
|
||||
ArrayList<Number> l2 = l1;
|
||||
ArrayList<? extends Number> l3 = l1;
|
||||
f3(i);
|
||||
f3(new ArrayList<Double>());
|
||||
|
||||
Object o = new A();
|
||||
f5((A) )
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
|
||||
package edu.slcc.asdv.caleb.mavenproject1;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Mavenproject1 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user