What happens to x



what will be the effect of the following code on variable x, and why:

class Sup {
int x=10;
void set(int a) {
x = a;
}
}

class Sub {
private int x;
}

class Demo {
public static void main(String args[]) {
Sub s1 = new Sub();
s1.set(2)
}
}

.



Relevant Pages

  • Help in Java swings(internal Frame)
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)
  • [PATCH,RFC 2.6.14 09/15] KGDB: SuperH-specific changes
    ... This adds basic support for KGDB on SuperH as well as adding some architecture ... -static int kgdb_uart_getchar ... -static void kgdb_uart_putchar ... * The command-line option can include a serial port specification ...
    (Linux-Kernel)
  • problem in java swings
    ... public int getSize() ... public void valueChanged{ ... private JScrollPane scrollPane1; ... public class PeakContainer extends JInternalFrame ...
    (comp.lang.java.programmer)
  • ToolTips in a View and TTN_NEEDTEXT
    ... extern int g_minWorkPeriod; ... void CDayView::CreateAllFonts ... void CDayView::DrawDayLog(CDC* pDC) ... BOOL CDayView::TimeToY ...
    (microsoft.public.vc.mfc)
  • [PATCH 6/20] FRV: Fujitsu FR-V CPU arch implementation part 4
    ... +static void register_irq_proc (unsigned int irq); ...
    (Linux-Kernel)