This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
class Student implements Serializable{ | |
private int id; | |
private String name; | |
public void getData(){ | |
int i; | |
String n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestDocument { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
String a = input.nextLine(); | |
String b = "a-"; | |
//when the user input is a- case 1 return false | |
//case 1 | |
System.out.println(a=="a-"||a=="A-"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ComplexNo{ | |
private int real; | |
private int img; | |
public void getNo(int a,int b){ | |
this.real=a; | |
this.img=b; | |
System.out.println("Real number is: "+this.real+"\nImaginary number is: "+this.img+"i"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
class ComplexNo{ | |
private: | |
int real; | |
int img; | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class point2d { | |
private float x; | |
private float y; | |
public point2d(){ | |
this.x=0; | |
this.y=0; | |
} | |
public point2d(float x,float y){ | |
this.x=x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num = raw_input('Enter \n') | |
left = num[0:5] | |
right = num[5:] | |
left_list = ['00010','00110','01110','11110','00001','00011','00111','01111','11111'] | |
right_list = ['01000','01100','01110','01111','10000','11000','11100','11110','11111'] | |
#import pdb | |
#pdb.set_trace() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean twoTwo(int[] nums) { | |
int len =nums.length; | |
boolean result = true; | |
for(int i =0;i<len-1;i++){ | |
if(len<=1 && nums[0]!=2)return true; | |
if(len>=2){ | |
if(nums[len-1]==2 && nums[len-2]!=2)result=false; | |
} | |
if(nums[i]==2 && nums[i+1]==2)result = true; | |
} |
NewerOlder