0
votes
2answers
40 views

Java calling overloaded methods

Consider this code segment class StockServer { StockServer(String company, int Shares,double currentPrice, double cashOnHand) {} double buy(int numberOfShares, double pricePerShare) { ...
0
votes
3answers
40 views

Installing Java on Windows 8

I'm in a Java I class and I have a new-ish laptop with Windows 8 on it. I've installed Java and changed the environment variables, created a Path, etc. When I enter java or javac in the cmd, it comes ...
2
votes
3answers
60 views

Use of final keyword in Java method performance? [duplicate]

Does the use final in method arguments allow the compiler oor runtime environment to work faster? For example, if you have a variable to pass to a method that you know will not be modified and be ...
1
vote
1answer
28 views

Mesuring memory use of a piece of code at runtime in Java

I have a project where I need to be able to measure the efficiency in CPU and in memory space of functions I receive as text and compile at run-time using the Java Compiler API. I am using ...
2
votes
1answer
44 views

JAVAC bug - Fails to recognize class as static (follow-up)

This follows up on a previous question: Java compiler fails to recognise static inner class The accepted answer gave a work-around that will be used if a better solution cannot be found. This ...
2
votes
2answers
40 views

Compiling Code - Creating an IDE

I've been deving an IDE for Java, Assembly and JMM for the last two months, and have been able to have the JMM compiler to run through the IDE and compile the given code. For some reason, I cannot ...
0
votes
1answer
43 views

How to pass input parameters to java program in php

to be specific, i'm creating a website that will allow user to Write and Execute java program online. I've write code that compiles and execute java program online using PHP. Here is the code : ...
2
votes
4answers
44 views

Ambiguous parameter for the compiler, when it's not ambiguous for me

Why is the compiler complaining here? public static void main(String[] args) { flipFlop(new Integer(11), 20f); } private static void flipFlop(int i, Float iRef) { } private static void ...
8
votes
4answers
87 views

Using Java application launcher

I have class Hello. I have successfully compiled the .class file from it and placed it into dir/subdir directory and have assigned it the dir.subdir package in its code. And I want to run it from the ...
0
votes
1answer
10 views

NodeFinder equivalent in org.eclipse.jdt.internal.compiler.ast?

There is a NodeFinder in org.eclipse.jdt.core.dom that can find the ASTNode in a given source code range. However, I am using a library that has ecj.jar as its Java compiler. The package ...
3
votes
4answers
41 views

javac code elimination capabilities

I'm having a hard time finding information about javac's code elimination capabilities: I read that if you have something like the following, the if-statement will be eliminated: static final ...
0
votes
3answers
31 views

Android errors after quick fix on String switch

While working on an Android project, I wanted to use a String switch for identifying which item on a ListView was clicked. Eclipse gave an error saying the targetting JRE had to be at least 1.7 to use ...
2
votes
6answers
60 views

Condition evaluation process in Java [duplicate]

Lets say I have the following condition: if ( myList == null || myList.isEmpty() || xomeX == someY ) What is the order of the evaluation of these conditions? Left or right, right to left or random ...
0
votes
4answers
56 views

Multiple Inheritance and class Object

Hi all I am pretty new to OOP .... We all know that Java does not support multiple inheritance but all Java classes inherit from class object and can inherit from one more class .Could we consider ...
5
votes
4answers
62 views

javac treating static final differently based on assignment method

When I compile: public static final boolean FOO = false; public static final void fooTest() { if (FOO) { System.out.println("gg"); } } I get an empty method fooTest() {}. However ...
0
votes
1answer
25 views

Setting up Java compiler on Windows laptop

I have a laptop with a Windows 7 OS 64-bit. I'm trying to set up the Java compiler so when I type in "javac" in the command prompt, it will compile the Java file I want. I've had it done on my laptop ...
0
votes
0answers
29 views

Suitable input type for java bytecode generator in asm lib

Creating a java compiler. Using jflex - lexical analysis, cup - parsing and asm- bytecode generation. jlex output is a scanner object. We create a parser object to do the parsing. What should we pass ...
-1
votes
0answers
42 views

How to add a Java compiler to a website?

I'm working on a Java tutorial website(in wordpress) and I thought that while learning coding if the user gets to compile the program on the website itself it would be great( in fact awesome!). I ...
-1
votes
4answers
88 views

How come my Java class creates multiple .class files when compiled?

I am creating a simple text editor program with Sublime Text on Mac and when I am compiling via the command line it produces 6 .class files. I am using the following command in the terminal to ...
1
vote
1answer
67 views

Compiling a Jar with java [duplicate]

For years I have been using an IDE (Eclipse) to compile my jar files for me, through the years I have learned about how they work however I still don't fully understand how the jar knows where the ...
0
votes
1answer
39 views

Compiling a java program to a jar errors in eclipse

I have created a Java program. It it is a game made with LWJGL. I have decided to import some textures with the built in Texture class from LWJGL (LWJGL is Light Weight Java Graphics Library with ...
1
vote
1answer
60 views

Does Java compiler optimize array index lookups?

for (int i = 0; i < array.length; ++i) { do something referencing array[i] do something referencing array[i] .... } In code such as this, is it ...
-2
votes
1answer
123 views

Why didn't anyone design or create JVM like middleware for other language( not only C or CPP)? [closed]

As we know that we have JVM for converting bytecode into machine code which is provided to it by Java Compiler. We all know that JVM is platform dependent. One question which comes to mind is why ...
0
votes
1answer
68 views

Java compiler code optimization breaches if condition?

I have a piece of code to create an object and increase the count of created objects. The code of creating object and increasing the count in guarded by an if condition checking if the count has ...
1
vote
2answers
46 views

JVM : Bytecode Confusion and JIT

So here's a question that came to my mind when I was studying Java. We know (please correct me if I am wrong!) that the Bytecode runs atop JVM. So does the JVM convert the Bytecode to the native ...
0
votes
2answers
45 views

Javac Compilation Errors, Confused

I have a single modified class file from a larger jar file that I want to recompile with javac. I have referenced the jar, but when I try to compile I recieve this output. ...
-1
votes
0answers
76 views

Minify JavaScript, HTML, CSS using Java

Basically I need three function: String minifyJavaScript(String javascriptBlock) ... String minifyHtml(String htmlBlock) ... String minifyCss(String cssBlock) ... So when I call, for example ...
0
votes
4answers
45 views

Java cannot find symbol for any Arrays?

So, It's so annoying. I made 2 programs. Number #1 : class Arrays2 { public static void main(String[] args){ String sentenceBest[] = {"This is the first sentence!"}; char chR[] = ...
0
votes
2answers
66 views

Java Compiler error with multiple generics type

I have a interface like this: public interface GenericWSEndpoint<T1,T2> { public void call(String url,String operationName, T1 requestObject, T2 responseObject,long timeout) throws ...
2
votes
3answers
71 views

is “someString” equivalent to new String(“someString”)? in java

I always thought that an expression like this in java: String tmp = "someString"; is just some kind of "syntactic sugar" for String tmp = new String("someString"); As I recently decompiled my ...

1 2 3 4 5 27
15 30 50 per page