This may be super easy to solve but I can't find the correct "google search term" and I've got tons of pages and none with the answer I'm looking for.
Does anyone knows or has a list of the available features of java as a language?
For instance.
Define classes:
class Employee {
}
Define attributes
private String name;
Methods...
I have read that most languages are becoming more and more like lisp, adopting features that lisp has had for a long time. I was wondering, what are the features, old or new, that lisp does not have? By lisp I mean the most common dialects like Common Lisp and Scheme.
...
What are the pro cons with having delegates having a reserved definition type.
For example in c if I want to define a function that takes a pointer to a function I can simply define
void F(bool (*pFn)(int));
In c# I have to take the extra step of first defining the delegate type similar if I had to create a typedef in c before I cou...
This is the only place I've ever seen and, or and not listed as actual operators in C++. When I wrote up a test program in NetBeans, I got the red underlining as if there was a syntax error and figured the website was wrong, but it is NetBeans which is wrong because it compiled and ran as expected.
I can see ! being favored over not but...
I was looking through a code tutorial just now, and found something interesting -- the import static feature introduced in JDK 5:
import static org.junit.Assert.assertEquals;
public class AdditionTest {
private int x = 1;
private int y = 1;
@Test public void addition() {
int z = x + y;
assertEquals(2, z);
/* ^ this ...
In Javascript, one of the reliable ways to convert a string to a number is the Number constructor:
var x = Number('09'); // 9, because it defaults to decimal
Inspired by this question, I started wondering what is the difference between the above and:
var x =new Number('09');
Number certainly looks better, but it seems like a sligh...
As a good programmer and code reviewer, I am always cringing when I see a developer catch "Exception". I was going to suggest C# add the "throws" clause from Java, but after reading the Anders Hejlsberg interview (http://www.artima.com/intv/handcuffs.html) I see why it is not there.
Instead, I would like to suggest the canthrow statemen...
Suppose I want to add minor syntactic sugars to Java. Just little things like adding regex pattern literals, or perhaps base-2 literals, or multiline strings, etc. Nothing major grammatically (at least for now).
How would one go about doing this?
Do I need to extend the bytecode compiler? (Is that possible?)
Can I write Eclipse plugin...
I started using LINQ (Language Integrated Query) when it was still in beta, more specifically Microsoft .NET LINQ Preview (May 2006). Almost 4 years have passed and here we are using LINQ in a lot of projects for the most diverse tasks.
I even wrote my final college project based on LINQ. You see how I like it.
LINQ and more recently P...
We need to write a script that needs to process movies (using C-based ffmpeg) and also update our databases. Also there would be some thread programming to accomplish with a worker-manager design. I am thinking of writing this in Ruby is there any good language to do this, if so what is its primary advantage for choosing?
We are based o...
I' ve been doing some programming lately and faced an issue which i found weird in c#. (at least for me)
public class Foo
{
//whatever
public class FooSpecificCollection : IList<Bar>
{
//implementation details
}
public FooSpecificCollection GetFoosStuff()
{
//return the collection
}
}
I wa...
I just want to understand why I cannot create a protected enum on C#?
The compiler refuses to accept that
Does anyone know why that may be?
...
I asked a question a few days ago about representing public static final and private static final fields in equivalent Ruby code. It got me thinking about what other syntax elements in Java might not translate directly to Ruby. Generics and Annotations come to mind. Anything else that would not translate well if you tried to port some Ja...
Hi,
I would like solve the problem (now hypothetical but propably real in future) of using extension methods and maginification of class interface in future development.
Example:
/* the code written in 17. March 2010 */
public class MySpecialList : IList<MySpecialClass> {
// ... implementation
}
// ... somewhere elsewhere ...
MySp...
The reason I ask this is that c# could easily have copied the java convention, or a variation of it, but opted for the more flexible approach of explicitly declaring namespaces inside files. As a Java programmer often there are things that I wish I could do differently, but namespaces is not one of them.
The flexbility has a certain ove...
For my curiosity sake I'm looking for a dynamic object oriented language that allows you to change true to false and vice versa.
Something like this:
true = false, false = true;
This should also affect any conditional statements, therefore 42 == 42 should return False.
Basically, with this premise, nothing in the language would be sa...
I'm trying to adopt some best practices to keep my python code efficient. I've heard that accessing a member variable inside of a loop can incur a dictionary lookup for every iteration of the loop, so I cache these in local variables to use inside the loop.
My question is about the loop statement itself... if I have the following class:...
This is not just an idle quip... I wonder if anybody knows if there's an actual design reason why Scala does not support interpolation similar to Groovy and other "syntactically better Javas"?
e.g.
var str1 = "World";
var str2 = "Hello, ${str1}";
...
I have a large tree. I want to be able to visualize it using a GUI tool. I want the ability to pan and zoom the tree image so that i can focus on part of the tree.
Is there an existing tool to achieve this?
If not i would like to write a small tool for myself to be able to do this. what is the simplest way of doing this? what computer ...
Hello colleagues,
Small preamble. I was good java developer on 1.4 jdk. After it I have switched to another platforms, but here I come with problem so question is strongly about jdk 1.6 (or higher :) ). I have 3 coupled class, the nature of coupling concerned with native methods. Bellow is example of this 3 class
public interface A
{
...