first commit
This commit is contained in:
parent
5754bb3310
commit
e4eec5133b
|
@ -0,0 +1,26 @@
|
|||
*.class
|
||||
|
||||
0.*
|
||||
|
||||
#folders#
|
||||
/target
|
||||
/neoDb*
|
||||
/data
|
||||
/src/main/webapp/WEB-INF/classes
|
||||
*/META-INF/*
|
||||
.resourceCache
|
||||
|
||||
# Packaged files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# Files generated by integration tests
|
||||
*.txt
|
||||
backup-pom.xml
|
||||
/bin/
|
||||
/temp
|
||||
|
||||
#IntelliJ specific
|
||||
.idea/
|
||||
*.iml
|
|
@ -0,0 +1,5 @@
|
|||
=========
|
||||
|
||||
## Core Java Lang OOP 2 Cookbooks and Examples
|
||||
|
||||
### Relevant Articles:
|
|
@ -0,0 +1,27 @@
|
|||
<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>com.baeldung</groupId>
|
||||
<artifactId>core-java-lang-oop-2</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<name>core-java-lang-oop-2</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-java</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-java</relativePath>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
<finalName>core-java-lang-oop-2</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,16 @@
|
|||
package com.baeldung.supertypecompilerexception;
|
||||
|
||||
public class MyClass {
|
||||
|
||||
private int myField1 = 10;
|
||||
private int myField2;
|
||||
|
||||
public MyClass() {
|
||||
//uncomment this to see the supertype compiler error:
|
||||
//this(myField1);
|
||||
}
|
||||
|
||||
public MyClass(int i) {
|
||||
myField2 = i;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.baeldung.supertypecompilerexception;
|
||||
|
||||
public class MyClassSolutionI {
|
||||
|
||||
private int myField1 = 10;
|
||||
private int myField2;
|
||||
|
||||
public MyClassSolutionI() {
|
||||
myField2 = myField1;
|
||||
}
|
||||
|
||||
public MyClassSolutionI(int i) {
|
||||
myField2 = i;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.baeldung.supertypecompilerexception;
|
||||
|
||||
public class MyClassSolutionII {
|
||||
|
||||
private int myField1 = 10;
|
||||
private int myField2;
|
||||
|
||||
public MyClassSolutionII() {
|
||||
setupMyFields(myField1);
|
||||
}
|
||||
|
||||
public MyClassSolutionII(int i) {
|
||||
setupMyFields(i);
|
||||
}
|
||||
|
||||
private void setupMyFields(int i) {
|
||||
myField2 = i;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.baeldung.supertypecompilerexception;
|
||||
|
||||
public class MyClassSolutionIII {
|
||||
|
||||
private static final int SOME_CONSTANT = 10;
|
||||
private int myField2;
|
||||
|
||||
public MyClassSolutionIII() {
|
||||
this(SOME_CONSTANT);
|
||||
}
|
||||
|
||||
public MyClassSolutionIII(int i) {
|
||||
myField2 = i;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.baeldung.supertypecompilerexception;
|
||||
|
||||
public class MyException extends RuntimeException {
|
||||
private int errorCode = 0;
|
||||
|
||||
public MyException(String message) {
|
||||
//uncomment this to see the supertype compiler error:
|
||||
//super(message + getErrorCode());
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="org.springframework" level="WARN" />
|
||||
<logger name="org.springframework.transaction" level="WARN" />
|
||||
|
||||
<!-- in order to debug some marshalling issues, this needs to be TRACE -->
|
||||
<logger name="org.springframework.web.servlet.mvc" level="WARN" />
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,13 @@
|
|||
*.class
|
||||
|
||||
#folders#
|
||||
/target
|
||||
/neoDb*
|
||||
/data
|
||||
/src/main/webapp/WEB-INF/classes
|
||||
*/META-INF/*
|
||||
|
||||
# Packaged files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
Loading…
Reference in New Issue