jvdubn's Profile User Rating: -----

Reputation: 7 Worker
Group:
Active Members
Active Posts:
52 (0.05 per day)
Joined:
08-June 11
Profile Views:
12,934
Last Active:
User is offline Aug 06 2012 08:03 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Volkswagen
Dream Kudos:
0
Icon   jvdubn has not set their status

Posts I've Made

  1. In Topic: Compilation error

    Posted 6 Aug 2012

    Try initializing your variables at the beginning. This helps to keep track of your variable names and ensures that the scope of the variable reaches outside of the braces.

    
    class Overtime{
    public static void main(String[] args)throws Exception{
    	
    String omout = "";//init vars
    String omin = "";
    String otout = "";
    String otin = "";
    
    
     if(overm.equals("yes")){
    
    	    System.out.print("Time-in: ");
    	omin=b.nextLine();//get omin
    	    System.out.print("Time-out: ");	
            omout=b.nextLine();//get omout
    
    }
    
    
    
     if(overt.equals("yes")){
    
    	System.out.print("Time-in: ");
        otin=b.nextLine();
    	System.out.print("Time-out: ");	
        otout=b.nextLine();
    
    }
    
    
    

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Programming Languages:
learning c++

Contact Information

E-mail:
Click here to e-mail me

Friends

jvdubn hasn't added any friends yet.

Comments

jvdubn has no profile comments yet. Why not say hello?