Skip to content

Commit

Permalink
Updated AnonymousObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
NMKrastev committed Jul 8, 2022
1 parent d402e87 commit 2c39232
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 54-AnonymousObjects/src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void main(String[] args) {
frame.add(deck.get(i - 1));
}

frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
frame.setLayout(new FlowLayout());
frame.setVisible(true);
Expand Down
2 changes: 1 addition & 1 deletion 55-InnerClasses/55-InnerClasses.iml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/out/production/" />
<output url="file://$MODULE_DIR$/out/production" />
<output-test url="file://$MODULE_DIR$/../out/test/55-InnerClasses" />
<exclude-output />
<content url="file://$MODULE_DIR$">
Expand Down
13 changes: 13 additions & 0 deletions 56-AnonymousInnerClass/56-AnonymousInnerClass.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/out/production/" />
<output-test url="file://$MODULE_DIR$/../out/test/56-AnonymousInnerClass" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
6 changes: 6 additions & 0 deletions 56-AnonymousInnerClass/src/Frame.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class Frame {

Frame() {

}
}
19 changes: 19 additions & 0 deletions 56-AnonymousInnerClass/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
public class Main {
public static void main(String[] args) {

/*anonymous class - an inner class without a name.
Only a single object is created from one.
The object may have “extras” or "changes"
and no need to create a separate innerclass
when it only needs it once.
Helps us to avoid cluttering code with a class name.
Syntax is similar to a constructor,
except that there is also a class definition
within a block of code.
GREAT FOR LISTENERS
*/


}
}

0 comments on commit 2c39232

Please sign in to comment.