Results 1 to 5 of 5
  1. #1
    ryn21 is offline Member
    Join Date
    Oct 2008
    Posts
    16
    Rep Power
    0

    Default compiler broken please help

    My compiler is not working for some reason can someone please tell me the exact output of this code and show the values of the variables after each line executes. Thank you

    Java Code:
    import java.util.*;
    import java.io.*;
    import javax.swing.JOptionPane;
    
    public class hwpra
    
    {
    
     
    
        static Scanner console = new Scanner(System.in);
    
     
    
        public static void main ( String[] args )
    	 {	 
    	  		int num1;
    			IntClass num2;
    						
    			num1=0
    			num2= new IntClass(20);
    			
    			System.out.println("line 3: in main: num1= "
    									+ num1 + ", num2= "
    									+ num2.getNum());
    			funcOne(num1, num2);
    			
    			System.out.println("line 5: in main after funcOne: "
    									+ "num1 = " + num1 + ", num2 = "
    									+ num2.getNum());
    	 }
    	  public static void funcOne (int a, IntClass b)
    		{ 
    			int x;
    			int z;
    			x = b.getNum();
    			
    			z= a + x;
    			
    			System.out.println("line 8: in funcOne: a = " + a
    									+ ", b = " + b,getNum()
    									+ ", x = " + x
    									+ "' and z = " + z);
    									
    			x = x + 5;
    			
    			System.out.println("line 10: in funcOne: a = " + a
    									+ ", b = " + b,getNum()
    									+ ", x = " + x
    									+ "' and z = " + z);
    									
    			a = a + 8;
    			b.setNum(a + x + z);
    			
    			System.out.println("line 10: in funcOne: a = " + a
    									+ ", b = " + b,getNum()
    									+ ", x = " + x
    									+ "' and z = " + z);
    
    
    		
    	
    	    }	
    	  
    
     
    }

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  3. #3
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default hhhmmm...

    Compiler's broken? How is it broken or what's the error msg you get. BTW, the forum isn't going to answer you're questions (from both postings) for two reasons:
    1) the forum doesn't do homework. If you have a specific question or problem about your code and you have shown that you have tried to work it out, then you will get help.
    2) The shown program isn't complete. What does the intClass class do? It's not shown.
    So... let's start with the compiler: how is it broken?
    CJSL

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    I've heard some excuses in my day, but this one tops most.

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    So download a new version of the JDK and you're in business. Access to the web you seemingly have.

Similar Threads

  1. Classpath is broken after Ctrl+S
    By vetalok in forum Eclipse
    Replies: 2
    Last Post: 08-18-2008, 10:35 AM
  2. Imports broken in JSP; HTTP Status 500-
    By Aerinai in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-13-2008, 10:27 PM
  3. Broken korean characters Urgent help needed!
    By priyap3 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 01-14-2008, 09:40 AM
  4. Asking for the compiler
    By fernando in forum Other IDEs
    Replies: 1
    Last Post: 08-06-2007, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •