This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Driver | |
| { | |
| public static Connection getConnection() { | |
| } | |
| } | |
| class Person | |
| { | |
| public Person() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Person | |
| { | |
| public Person() { | |
| } | |
| public String getName() { | |
| } | |
| public int connectToDB() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class Shape { | |
| } | |
| class Rectangle extends Shape { | |
| } | |
| class Square extends Shape { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Rectagle { | |
| } | |
| class Square extends Rectangle { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Connection | |
| { | |
| /* generic code ; private */ | |
| /* the interface is public */ | |
| public Connection() { | |
| } | |
| public int connectTo() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct node | |
| { | |
| int info; | |
| struct node *left; | |
| struct node *right; | |
| }; | |
| struct node *common_ancestor(struct node *head, struct node* n1, | |
| struct node *n2) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct node | |
| { | |
| int info; | |
| struct node *next; | |
| }; | |
| int cycle(struct node *head) | |
| { | |
| struct node *slow, *fast; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Hello.java */ | |
| public class Hello | |
| { | |
| public static void main(String[] args) | |
| { | |
| System.out.println("Hello World"); | |
| } | |
| } | |
| /* Hello2.java */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.lang.reflect.*; | |
| class Foo | |
| { | |
| private int i = 10; | |
| public int getI() { return i; } | |
| } | |
| class PrivateTest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl -w | |
| use strict; | |
| # Lookup the calling object's properties. If not found, lookup for the key in | |
| # base class. | |
| sub dispatch { | |
| my $props = shift; | |
| my $key = shift; | |
| return $props->{$key} || ($props->{'base'} && $props->{'base'}($key)) |