Skip to content

Instantly share code, notes, and snippets.

class Driver
{
public static Connection getConnection() {
}
}
class Person
{
public Person() {
}
class Person
{
public Person() {
}
public String getName() {
}
public int connectToDB() {
}
abstract class Shape {
}
class Rectangle extends Shape {
}
class Square extends Shape {
}
class Rectagle {
}
class Square extends Rectangle {
}
class Connection
{
/* generic code ; private */
/* the interface is public */
public Connection() {
}
public int connectTo() {
}
struct node
{
int info;
struct node *left;
struct node *right;
};
struct node *common_ancestor(struct node *head, struct node* n1,
struct node *n2)
{
struct node
{
int info;
struct node *next;
};
int cycle(struct node *head)
{
struct node *slow, *fast;
/* Hello.java */
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World");
}
}
/* Hello2.java */
import java.lang.reflect.*;
class Foo
{
private int i = 10;
public int getI() { return i; }
}
class PrivateTest
#!/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))